Amazon dynamodb 如何在DynamoDb中查询对象列表(使用CLI)
下面是我使用Amazon dynamodb 如何在DynamoDb中查询对象列表(使用CLI),amazon-dynamodb,aws-cli,dynamo-local,dynamodb-queries,Amazon Dynamodb,Aws Cli,Dynamo Local,Dynamodb Queries,下面是我使用 aws dynamodb scan --table-name "hotel" --endpoint-url http://localhost:8088 { "Count": 2, "Items": [ { "dc": { "N": "0" }, "sw": { "L": [
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
请建议我如何查询表以检索结果。按照表的结构,很难按字段查询数组。请尝试将每个项保存为一行。有一个很好的示例,说明您的查询是从AWS/DynamoDB(而不是本地主机)进行的?我根据示例
aws dynamodb查询--表名“hotel”--投影表达式“sw”--关键条件表达式“sw=:v1”--表达式属性值尝试了这个方法file:///tables/key.json --端点urlhttp://localhost:8088
我得到了这个错误发生了一个错误(ValidationException)调用查询操作:Query condition missed key schema时
我尝试在dynamodb为表提供的界面中使用sw进行筛选,但对于字段“sw”是列表,我找不到任何选项。您能否运行一个aws dynamodb description table--表名“hotel”
并编辑您的问题以添加结果?如果我们能了解更多关于你们桌子的细节,我相信我们能帮助你们。德克萨斯州!
aws dynamodb query --table-name "hotel" --key-conditions file:////tables/key1.json --endpoint-url http://localhost:8088 where