我试图使用JSON文档向表中添加值,但总是遇到错误。我的JSON规范有什么问题?
我不断得到:
错误:
当我奔跑时
aws dynamodb batch-write-item --request-items file://notesTable.json
:
Parameter validation failed:
Invalid type for parameter RequestItems.notesTable[0].PutRequest.Item.questions.
M, value: [OrderedDict([('what is Dynamo?', OrderedDict([('S', 'a non-relational
document based NoSQL database')]))])], type: <class 'list'>, valid types: <clas
s 'dict'>
目标:
topics questions
------ ---------
Dynamo {"what is Dynamo?":{"S":"a non-relational document based NoSQL database"}}
JSON结构
{
"notesTable": [
{
"PutRequest": {
"Item": {
"topic":{"S":"Dynamo"},
"questions": {
"M": [
{"what is Dynamo?":{"S":"a non-relational document based NoSQL database"}}
]
}
}
}
}
]
}