Trying to use KeyConditionExpression according to dynamodb api operator using nodejs sdk. KeyConditionExpression highlighting is not supported using the nodejs SDK.
Here is what i did
Created a table with a hash and a range.
Table : TABLE1 Hash Attribute Name : Provider ( String) Range Attribute Key : ScheduledEndTime ( Number )
Here is the payload to run the Dynamo DB query:
{ TableName: 'TABLE1', ConsistentRead: true, Select: "ALL_ATTRIBUTES", KeyConditionExpression: 'Provider = :v_provider AND ScheduledEndTime > :v_scheduledEndTime', ExpressionAttributeValues: { ":v_provider": { S: "amazon" }, ":v_scheduledEndTime": { N: "10" } } };
But the above payload is below errors
[Error: MultipleValidationErrors: There were 2 validation errors: * MissingRequiredParameter: Missing required key 'KeyConditions' in params * UnexpectedParameter: Unexpected key 'KeyConditionExpression' found in params] [Error: MultipleValidationErrors: There were 2 validation errors: * MissingRequiredParameter: Missing required key 'KeyConditions' in params * UnexpectedParameter: Unexpected key 'KeyConditionExpression' found in params]
According to the document, if we use KeyConditionExpression, the SDK should not consider the KeyConditions key, and I also tried with the latest nodejs sdk. Is there something wrong with the payload template?
Santhosh Nagulanchi
source share