当我使用
扫描表时,下面是DynamoDb中表结构的样子aws dynamodb scan --table-name "hotel" --endpoint-url http://localhost:8088
{
"Count": 2,
"Items": [
{
"dc": {
"N": "0"
},
"sw": {
"L": [
{
"N": "1"
}
]
}
},
{
"dc": {
"N": "0"
},
"sw": {
"L":[]
},
}
],
"ScannedCount": 2,
"ConsumedCapacity": null
}
现在我想查询sw: []
所在的表格。我正在使用以下查询来检索结果。
aws dynamodb query --table-name "hotel" --key-conditions file:////tables/key1.json --endpoint-url http://localhost:8088 where
key1.json
{
"sw":{
"ComparisonOperator":"EQ",
"AttributeValueList": [ {"L":[]} ]
}
}
但我得到以下错误
An error occurred (ValidationException) when calling the Query operation: Query condition missed key schema element
请建议我如何查询表格以检索结果。
答案 0 :(得分:0)
表的结构化方式很难按其字段查询数组。尝试将每个项目保存为一行。