查询的格式应该如何构造以在 AWS DynamoDB 中发送带有 'Greater than' 条件的调用?
How should the Query's format be structured for sending a call with 'Greater than' condition in AWS DynamoDB?
我想 运行 对我 table 的主键进行比查询更大的查询。
后来才知道greater than
查询只能在sort keys
上执行,不能在primary keys
上执行。所以,我现在重新设计了我的 table,这是新的截图:(StoreID
是主键,& OrderID
是排序键)
如果我想 运行 像 return those items whose 'OrderID' > 1005
这样的查询,我应该如何格式化查询?
更具体的说,Query condition 应该提什么才符合我的要求?
非常感谢!
您可以使用以下 CLI 命令 运行 查询 "return those items in store with storeid='STR100' whose 'OrderID' > 1005"。
aws dynamodb query --table-name <table-name> --key-condition-expression "StoreID = :v1 AND OrderID > :v2" --expression-attribute-values '{":v1": {"S": "STR100"}, ":v2": {"N": 1005}}'
我想 运行 对我 table 的主键进行比查询更大的查询。
后来才知道greater than
查询只能在sort keys
上执行,不能在primary keys
上执行。所以,我现在重新设计了我的 table,这是新的截图:(StoreID
是主键,& OrderID
是排序键)
如果我想 运行 像 return those items whose 'OrderID' > 1005
这样的查询,我应该如何格式化查询?
更具体的说,Query condition 应该提什么才符合我的要求?
非常感谢!
您可以使用以下 CLI 命令 运行 查询 "return those items in store with storeid='STR100' whose 'OrderID' > 1005"。
aws dynamodb query --table-name <table-name> --key-condition-expression "StoreID = :v1 AND OrderID > :v2" --expression-attribute-values '{":v1": {"S": "STR100"}, ":v2": {"N": 1005}}'