我使用DynamoDB和查询API用于所有ComparisonOperators,除了" EQ"它一直给我"尝试的条件约束不是一个可转换的操作"错误。
是什么原因?
{"TableName":"My_Table_name",
"IndexName":"titleIndex",
"Select":"ALL_ATTRIBUTES",
"KeyConditions":
{"title":
{"AttributeValueList":[{"S":"title2"}],
"ComparisonOperator":"NE"}
}
}
答案 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