You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// title beginning with the letter "A" through the letter "L"varparams={TableName : "Movies",ProjectionExpression:"#yr, title, info.genres, info.actors[0]",KeyConditionExpression: "#yr = :yyyy and title between :letter1 and :letter2",ExpressionAttributeNames:{"#yr": "year"},ExpressionAttributeValues: {":yyyy":1992,":letter1": "A",":letter2": "L"}};docClient.query(params,function(err,data){});
Scan
varparams={TableName: "Movies",ProjectionExpression: "#yr, title, info.rating",FilterExpression: "#yr between :start_yr and :end_yr",ExpressionAttributeNames: {"#yr": "year",},ExpressionAttributeValues: {":start_yr": 1950,":end_yr": 1959}};console.log("Scanning Movies table.");docClient.scan(params,onScan);functiononScan(err,data){if(err){console.error("Unable to scan the table. Error JSON:",JSON.stringify(err,null,2));}else{// print all the moviesconsole.log("Scan succeeded.");// continue scanning if we have more movies, because// scan can retrieve a maximum of 1MB of dataif(typeofdata.LastEvaluatedKey!="undefined"){console.log("Scanning for more...");params.ExclusiveStartKey=data.LastEvaluatedKey;docClient.scan(params,onScan);}}}