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

标签 nosql amazon-dynamodb

我在 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/

相关文章:

database - Django模型/SQLAlchemy肿!有没有真正的Pythonic数据库模型?

data-mining - NoSQL 作为数据挖掘解决方案?

mysql - 为什么 NoSQL 应该执行得更快?

nosql - Cassandra/BigTable 数据模型 - 构建索引的最佳方法是什么?

amazon-web-services - 使用低基数的排序键有什么缺点吗?

cassandra - NOSQL DB 行单行被检索

amazon-web-services - 在 DynamoDB 表 : AttributeDefinitions is not specified 上创建索引时出错

swift - DynamoDB 扫描 : Does not return correct values

amazon-web-services - AttributeDefinitions 和 KeySchema 中的属性集必须在 Resources/DynamoDB/Properties 中匹配

sdk - dynamodb 教程