我有一个多步骤流程,
-从DynamoDB派生对象数组
-操作某些对象的属性值
-将这些对象写回到DynamoDB
当我使用putItem方法时,我想知道在将对象发送到DynamoDB时是否总是需要放置对象的每个属性。还是可以将整个对象作为一个“项目” 发送?
//++++++++++++++++++++++++++
//1) The data-Object I retrieve from Dynamodyb:
data = { Item:
{ score: 90,
gtin_RefBook: 'a',
directConnection: true,
gtin_RecBook: 'u'
}
}
//++++++++++++++++++++++++++
// 2) The manipulation I perform on the object:
data.Item.score = 99;
//++++++++++++++++++++++++++
// 3) Current code to write the information back to DynamoDB (as part of the params to be passed to putItem)
Item: {
"gtin_RefBook": gtinRefBook,
"gtin_RecBook": gtinRecBook,
"score": 90,
"directConnection": true
}
//##########################################################################
// **What I would like to do instead:**
Item: {data}
// so that I can just use the updated data-Object. Is there a possibility to do this?