gpt4 book ai didi

nosql - DynamoDB 错误 : "Query key condition not supported"

转载 作者:行者123 更新时间:2023-12-04 17:43:26 29 4
gpt4 key购买 nike

我在 aws dynamodb 中查询数据库中的数据并在 KeyConditionExpression 上遇到错误消息。

我正在查询“dominant_temporality”和“dt”。这些构成了我的复合分区键 - dt 对于每一行和我的排序键都是唯一的。

我正在运行的代码:

var params = {
TableName : "deardiary",
KeyConditionExpression: "#d = :dominant_temporality and dt between :minDate and :maxDate",
ExpressionAttributeNames: {
"#d" : "temporality"
},
ExpressionAttributeValues: { // the query values
":dominant_temporality": {S: "present"},
":minDate": {N: new Date("October 8, 2018").valueOf().toString()},
":maxDate": {N: new Date("October 9, 2018").valueOf().toString()}
}
};

最佳答案

检查您是否在不允许的 HASH 上使用 BETWEEN - 您只能对 HASH 使用 EQ 或对范围键使用 begins_with

关于nosql - DynamoDB 错误 : "Query key condition not supported",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53354971/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com