I have a AWS Lambda with NodeJS 10.x. This lambda is trying to scan a DynamoDB table based on a 'FilterExpression'. I am using DocumentClient to perform the 'scan' operation. I am not able to read and iterate over the resultant object despite using various methods.
I tried using the following ways:
(1) var flatData = AWS.DynamoDB.Converter.unmarshall(itemdata);
(2) var flatData = AWS.DynamoDB.Converter.output({"M":itemdata});
(3) var flatData = AWS.DynamoDB.Converter.output({"M":itemdata});
(1) and (3) works i.e. when I console.log the flatData I get the following:
{ origin: undefined,
status_history: undefined,
r_id: undefined,
external_note: undefined,
...
}
The DynamoDB table has 3 matching records for the FilterExpression that I am using. The NodeJS code also iterates 3 times but with values like mentioned above.
All these keys have values. I would like to know how can I get the values of the keys that we see above. I have tried JSON.stringify(), JSON.parse() without any luck. By the way, I am taking this approach for my Lambda: exports.handler = function(event, context, callback) {...
Items
property of the returneddata
. – jarmod