dynamoDB查询全局二级索引与HashKeyValue和RangeKeyCondition不工作的JavaScript

时间:2016-02-05 10:14:23

标签: javascript amazon-dynamodb

我正在使用JavaScript执行以下dynamoDB查询:

dynamoDB.query({
        "TableName"    :"table_name",
        "IndexName": "Approval-Date-index",
        "HashKeyValue": {"Approval": {"AttributeValueList": [{"S": 'Approved'}],"ComparisonOperator": "EQ"}},
        "RangeKeyCondition" : {"Date" : {"AttributeValueList": [{"S": "0"}]}},
        // "ScanIndexForward"  : true,
        "AttributesToGet":["Id","Url","userName","userPicture","Title","Date","Type","Description"]
    },
    function(error, result) 
    {
        console.log(result);
        console.log(error);
    });

我收到以下错误:

  

ValidationException:检测到1个验证错误:'rangeKeyCondition.comparisonOperator'的值null无法满足约束:Member不能为null

1 个答案:

答案 0 :(得分:0)

对我而言,它给了我同样的错误 " ValidationException:检测到1个验证错误:' rangeKeyCondition.comparisonOperator'未能满足约束:成员不能为空" 我所做的是更新Dynamodb SDK,我解决了问题