Reputation: 1590
I am running below dynamo DB scan query in AWS
const dynamoDb = require('aws-sdk/clients/dynamodb.js');
const dynmoDBClient = new dynamoDb.DocumentClient({ region: "REGION"});
let params = {
"TableName":"Users",
"ScanFilter":{
"name":{
"AttributeValueList":[
{
"S":""
}
],
"ComparisonOperator":"GT"
}
},
"Select":"ALL_ATTRIBUTES"
}
let result = null;
result = await dynmoDBClient.scan(params).promise();
When I run the query , I get below error -
ERROR occurred while querying data from DB :
{"message":"One or more parameter values were invalid:
ComparisonOperator GT is not valid for M AttributeValue type"}
As per table definition , name attribute is of type S (string)
and not M (map)
But I am still getting this error.
Can anybody please help here as I am not getting what is the issue here ?
Upvotes: 0
Views: 716
Reputation: 7142
AWS maintains sample code of core DynamoDB operations in various languages. Here's their sample for Scan in Node.js:
ScanFilter
is legacy so don't go there.
Upvotes: 1