[英]What does DynamoDBMapper's query method return when value doesn't exist?
Hi I'm trying to see if a value exist in my GSI and if it is return the query result or otherwise throw an error.您好,我正在尝试查看我的 GSI 中是否存在值,以及它是否返回查询结果或以其他方式抛出错误。 I was wondering if the query method from the DynamoDBMapper class is the right one to use and what it returns when a value doesn't exist?我想知道来自 DynamoDBMapper class 的查询方法是否是正确的使用方法,当值不存在时它返回什么? As it doesn't seem to say in their doc .正如他们的文档中似乎没有说的那样。 Thanks!谢谢!
All DynamoDB clients return an empty response if an item does not exist.如果项目不存在,所有 DynamoDB 客户端都会返回空响应。 It would not return an error because the request was successful, the item just did not exist.它不会返回错误,因为请求成功,该项目只是不存在。
A Query operation always returns a result set.查询操作总是返回一个结果集。 If no matching items are found, the result set will be empty.如果没有找到匹配项,则结果集将为空。 Queries that do not return results consume the minimum number of read capacity units for that type of read operation.不返回结果的查询会消耗该类型读取操作的最小读取容量单位数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.