我在把一张由<
<table border="1"><tr><th>userId</th><th>brandId</th><th>createdBy</th><th>modifiedBy</th><th>preferences</th><th>version</th></tr><tr><td>TU0001</td><td>TEST BRAND</td><td>{"channel":{"S":"website"},"date":{"S": "2022-06-13T08:16:26.300Z"},"userId":{"S":"TU0001"}}</td><td>{"channel":{"S":"website"},"date":{"S": "2022-06-13T015:26:10.200Z"},"userId":{"S":"TU0001"}}</td><td>{"Colour": {"S": "Red" },"Size":{"S": "XL" }}</td><td>1</td></tr></table>
位于DynamoDB的表格结构中,只有JSON的数值被储存为MAP。 当我们利用人口与健康调查进行移徙时,它就将JSON作为扼杀性价值,而不是按预期的MAP。
我将变革规则定义为:
"attribute-mappings": [
{
"target-attribute-name": "userId",
"attribute-type": "scalar",
"attribute-sub-type": "string",
"value": "${userId}"
},
{
"target-attribute-name": "brandId",
"attribute-type": "scalar",
"attribute-sub-type": "string",
"value": "${brandId}"
},
{
"target-attribute-name": "createdBy",
"attribute-type": "document",
"attribute-sub-type": "dynamodb-map",
"value": {
"M": {
"S": "${createdBy}"
}
}
},
{
"target-attribute-name": "modifiedBy",
"attribute-type": "document",
"attribute-sub-type": "dynamodb-map",
"value": {
"M": {
"S": "${modifiedBy}"
}
}
},
{
"target-attribute-name": "preferences",
"attribute-type": "document",
"attribute-sub-type": "dynamodb-map",
"value": {
"M": {
"S": "${preferences}"
}
}
},
{
"target-attribute-name": "version",
"attribute-type": "scalar",
"attribute-sub-type": "number",
"value": "${version}"
}
]
我也试图将地图添加如下,并在达扬莫亚的一张空洞地图。
"value": {
"M": "${preferences}"
}
希望的人能够提供帮助。