0

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"}]}

1 Answer 1

2

The DynamoDB Document SDK for NodeJS does exactly what you want: https://github.com/awslabs/dynamodb-document-js-sdk

There are instructions on how to get started and code snippets for basic API calls in the README.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.