admin管理员组文章数量:1026989
I'm trying to run a query on a dynamoDB table with the key condition as such
KeyConditions: {
userID: {
ComparisonOperator: 'GE',
AttributeValueList: [{N: '0'}]
}
}
When I run this query with the ComparisonOperator as 'EQ' no problems occur. However when it's 'GE' I get an error stating that the query key condition is not supported.
Note that userID is a hash key
I'm trying to run a query on a dynamoDB table with the key condition as such
KeyConditions: {
userID: {
ComparisonOperator: 'GE',
AttributeValueList: [{N: '0'}]
}
}
When I run this query with the ComparisonOperator as 'EQ' no problems occur. However when it's 'GE' I get an error stating that the query key condition is not supported.
Note that userID is a hash key
Share Improve this question asked Mar 27, 2014 at 18:47 sonicfire3000sonicfire3000 371 gold badge2 silver badges5 bronze badges1 Answer
Reset to default 5From the Dynamo DB Query Documentation:
A Query operation directly accesses items from a table using the table primary key, or from an index using the index key. You must provide a specific hash key value. You can narrow the scope of the query by using parison operators on the range key value, or on the index key. You can use the ScanIndexForward parameter to get results in forward or reverse order, by range key or by index key.
You must provide a hash key to query Dynamo DB. You could acplish what you're trying to do with a Scan
operation or with multiple Query
operations, but there's no way to specify a condition other than equals for a hash key in DynamoDB.
I'm trying to run a query on a dynamoDB table with the key condition as such
KeyConditions: {
userID: {
ComparisonOperator: 'GE',
AttributeValueList: [{N: '0'}]
}
}
When I run this query with the ComparisonOperator as 'EQ' no problems occur. However when it's 'GE' I get an error stating that the query key condition is not supported.
Note that userID is a hash key
I'm trying to run a query on a dynamoDB table with the key condition as such
KeyConditions: {
userID: {
ComparisonOperator: 'GE',
AttributeValueList: [{N: '0'}]
}
}
When I run this query with the ComparisonOperator as 'EQ' no problems occur. However when it's 'GE' I get an error stating that the query key condition is not supported.
Note that userID is a hash key
Share Improve this question asked Mar 27, 2014 at 18:47 sonicfire3000sonicfire3000 371 gold badge2 silver badges5 bronze badges1 Answer
Reset to default 5From the Dynamo DB Query Documentation:
A Query operation directly accesses items from a table using the table primary key, or from an index using the index key. You must provide a specific hash key value. You can narrow the scope of the query by using parison operators on the range key value, or on the index key. You can use the ScanIndexForward parameter to get results in forward or reverse order, by range key or by index key.
You must provide a hash key to query Dynamo DB. You could acplish what you're trying to do with a Scan
operation or with multiple Query
operations, but there's no way to specify a condition other than equals for a hash key in DynamoDB.
本文标签: javascriptQuery dynamoDB with key condition 39GE39 on a hash keyStack Overflow
版权声明:本文标题:javascript - Query dynamoDB with key condition 'GE' on a hash key - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745664112a2162073.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论