1
我正在使用DynamoDB .NET對象持久性模型掃描具有以下條件的表。如何使用DynamoDBContext對結果進行批處理
public IEnumerable<Product> GetProducts(string attribute1Value, string attribute2Value
{
IEnumerable<Product> products = null;
try
{
RegionEndpoint region = RegionEndpoint.GetBySystemName("us-east-1");
AmazonDynamoDB client = new AmazonDynamoDBClient(account.AwsAccessKey, account.AwsSecretKey, region);
DynamoDBContext context = new DynamoDBContext(client);
products = context.Scan<Product>(
new ScanCondition("attribute1", ScanOperator.Equal, attribute1Value),
new ScanCondition("attribute2", ScanOperator.Equal, attribute2Value));
}
catch (AmazonServiceException ase)
{
log.Error("Amazon Service Exception, Message: " + ase.Message + ", request id: " + ase.RequestId);
}
catch (Exception e)
{
log.Error("Exception: " + e.Message);
}
return products;
}
如何當它超過1個MB限制時,我使用DynamoDBContext由DynamoDB設置我處理輸出? 謝謝
Pavel,非常感謝。我花了幾個小時試圖弄清楚這一點。希望有一些我忽略的文檔。 – user1446809
http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DotNetORMDynamoDBContext.html – marco