尝试条件约束不是可索引操作

时间:2014-08-13 18:07:42

标签: amazon-dynamodb nosql

我使用DynamoDB和查询API用于所有ComparisonOperators,除了" EQ"它一直给我"尝试的条件约束不是一个可转换的操作"错误。

是什么原因?

{"TableName":"My_Table_name",
    "IndexName":"titleIndex",
    "Select":"ALL_ATTRIBUTES",
    "KeyConditions":
        {"title":
            {"AttributeValueList":[{"S":"title2"}],
            "ComparisonOperator":"NE"}
        }
}

2 个答案:

答案 0 :(得分:4)

For query operation, only the following comparison operators are supported:

EQ | LE | LT | GE | GT | BEGINS_WITH | BETWEEN

You can use NE for scan operation.

Refer: http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Condition.html

答案 1 :(得分:0)

这可能会有所帮助: DynamoDB query with Comparison Operators

您可以从中获取更多信息:

http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html 对于KeyConditions,仅支持以下比较运算符:

情商| LE | LT | GE | GT | BEGINS_WITH | BETWEEN