我正在尝试batchWrite使用DocumentClient一组项目(JSON)中的DynamoDB 执行操作
这是我的代码:
var items = [];
for (i = 0; i < orders.length; i++) {
var ord = orders[i]; //a simple json object
var item = {
'PutRequest': {
'Item' : ord[i]
}
};
items.push(item);
}
var params = {
RequestItems: {
'my_table_name': items
}
};
var docClient = new AWS.DynamoDB.DocumentClient();
docClient.batchWrite(params, function(err, data) {
if (err) {
console.log('There was a problem putting the items in the table');
context.fail(err);
}
else {
console.log('Items updated in …Run Code Online (Sandbox Code Playgroud) 我对Amazon DynamoDB相当陌生。我目前有20000行需要添加到表中。但是,根据我所阅读的内容,使用BatchWriteItem类和25个WriteRequests似乎一次最多只能写25行。有可能增加吗?如何一次写超过25行?目前大约需要15分钟才能写入所有20000行。谢谢。
database amazon-web-services amazon-dynamodb amazon-redshift