AWS-DynomoDB两个参数,用于使用c#过滤结果

时间:2018-06-28 10:27:42

标签: c# amazon-web-services amazon-dynamodb

我们如何使用两个参数从dynomodb获得结果?我正在使用下面的代码,这是行不通的。

        var _request = new QueryRequest
        {
            TableName = "Attendence",
            KeyConditionExpression = "Roster_EmpID = :Roster_EmpID and Roster_CreatedDateTime between :v_start and :v_end",
            ExpressionAttributeValues = new Dictionary<string, AttributeValue> {
                {":Roster_EmpID", new AttributeValue {  S = result.empId    }}
                ,{":v_start", new AttributeValue {   S = result.fromDate.ToString(AWSSDKUtils.ISO8601DateFormat)  }}
                ,{":v_end", new AttributeValue { S = result.toDate.ToString(AWSSDKUtils.ISO8601DateFormat)    }}
            },
            IndexName = "Roster_EmpID-index"
        }; 
        var _response = await _client.QueryAsync(_request);

但是它没有返回结果,请帮助我获得结果。我已经浪费了2天,仍然找不到答案。

1 个答案:

答案 0 :(得分:0)

我认为您可能正在寻找FilterExpression

KeyConditionExpression = "Roster_EmpID = :Roster_EmpID ",
FilterExpression = "Roster_CreatedDateTime between :v_start and :v_end",