I'm using the AWS SDK with Express and Nodejs. I am doing a scan on the table Users. I want to map the attributes so they are dont appear in the JSON. I have the following code:
app.get('/users',function(req, res) {
var params = {
TableName: 'Users'
};
dynamodb.scan(params, function(err, data) {
if (err) {
console.log(err, err.stack); // an error occurred
} else {
console.log(data);
// successful response
res.send(data);
}
});
});
It returns:
{"Items":[{"id":{"S":"test"}}]}
I want it to return:
{"Items":[{"id":"test"}]}