iam created a table in amazon dynamoDB using web console. this is my table structure after adding some data.
timestamp | userid | text
101 | manaf | haaaai
102 | manaf | hello
I need to get the data between two res limits.
this is my code in js.
var AWS = require("aws-sdk");
AWS.config.update({
region: "regionName",
});
var docClient = new AWS.DynamoDB.DocumentClient()
var table = "testTable";
var params = {
TableName: table,
FilterExpression :['userid = :id','res >= :val1','res <= :val2'],
ExpressionAttributeValues : {':id' : 'manaf','res':101, 'res':102}
};
docClient.scan(params, function(err, data) {
if (err) console.log(err);
else console.log(data);
});
But i got error like this.
{ [InvalidParameterType: Expected params.FilterExpression to be a string]
message: 'Expected params.FilterExpression to be a string',
code: 'InvalidParameterType',
time: Thu May 19 2016 17:24:57 GMT+0530 (IST) }
How to add multiple filter options in dynamo db scan method?