【发布时间】:2019-11-17 13:22:12
【问题描述】:
我有一个要求,在 Dynamodb 中查询表时只需要返回一行。 我可以在 aws-cli 中看到一个名为“max-items”的参数,它显然限制了查询的结果大小。这是示例查询:
aws dynamodb query --table-name testTable --key-condition-expression "CompositePartitionKey = :pk"
--expression-attribute-values '{ ":pk": { "S": "1234_125" }, ":ps": { "S": "SOME_STATE" }
}'
--filter-expression 'StateAttribute IN (:ps) AND attribute_not_exists(AnotherAttribute)'
--index-name GSI_PK_SK --endpoint-url http://localhost:8000 --max-items 1
但我无法在 Go 中找出任何类似的关键字/属性。
以下是我能找到的相关内容:How to set limit of matching items returned by DynamoDB using Java?
【问题讨论】:
标签: go amazon-dynamodb