我有14条记录,这次扫描确切地返回了14条记录,但是应该返回10.我做错了什么?
public IList<Contact> GetContacs(string firstContactToScan)
{
using (var context = new DynamoDBContext(new AmazonDynamoDBClient()))
{
var data = context.FromScan<Contact>(new ScanOperationConfig {Limit = 10}).ToList();
return data;
}
}
由于
答案 0 :(得分:0)
您可以尝试以下代码:
AmazonDynamoDBClient client = new AmazonDynamoDBClient();
var request = new ScanRequest
{
TableName = "yourTableName",
Limit = 10
};
var response = client.Scan(request);
var result = response.ScanResult;
foreach (Dictionary<string, AttributeValue> item in response.ScanResult.Items)
{
PrintItem(item);
}
您还可以在以下请求中指定其他选项 Reference Link
希望有所帮助