我正在使用DynamoDB的.NET SDK通过应用BETWEEN过滤条件来扫描记录。但我没有得到任何结果 - 计数打印为0(但结果可在我通过AWS控制台验证的数据库中获得)。知道这段代码可能有什么问题吗?
AmazonDynamoDBClient client = new AmazonDynamoDBClient();
AttributeValue av1 = new AttributeValue();
av1.N = "373543227";
AttributeValue av2 = new AttributeValue();
av2.N = "373543247";
Condition c = new Condition();
c.ComparisonOperator = ComparisonOperator.BETWEEN;
c.AttributeValueList.Add(av1);
c.AttributeValueList.Add(av2);
ScanRequest sr = new ScanRequest();
sr.TableName = "history";
sr.ScanFilter.Add("MyNumericField", c);
ScanResponse srp = client.Scan(sr);
Console.WriteLine("Count {0}", srp.Count);
文档对DynamoDB2没有帮助! :(
答案 0 :(得分:0)
我真傻!这只是部分扫描,直到1 MB结果,之后我不得不继续sr.ExclusiveStartKey = srp.LastEvaluatedKey
。这很有用。