iam created the table in amazon dynamoDB using the web console. this is my table structure after adding some data.
time stamp | userid | text
101 | manaf | haaaai
102 | manaf | Hello
I need to get data between two res limits.
this is my js code.
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 an 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 several filter parameters to dynamo-db-scan method?
source share