-1

i need the below array format data in nodejs serverless Dynamodb

i need my output like the below json format how to i get it the format

"user": { "e8de014a-22c1-12bf-4653-577c8031138":{ "email": "mailto:[email protected]", "method": [ "email" ], "name": "Raj", "onDemand": "yes", "pollSchedule": "None", "pollTarget": "Educator", "telephone": "12345678", "user_id": "413ca05f-ed91-50e7-1974-3e0280ca4a3d" }, "5f4db059-c8a3-e673-iygk-d857425e1077": { "created_at": 1674459043374, "email": "mailto:[email protected]", "method": [ "email" ],{ "name": "New testing", "onDemand": "yes", "pollSchedule": "None", "pollTarget": "Educator", "telephone": "12345678", "user_id": "413ca05f-ed91-50e7-2635-3e0280ca4a3d" } } 

1 Answer 1

0

Use the DynamoDB Document Client to Put and Get the data as it's native JSON format.

The DynamoDB document client simplifies working with items by abstracting the notion of attribute values. This abstraction annotates native JavaScript types supplied as input parameters, as well as converts annotated response data to native JavaScript types.

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

5 Comments

we are using a update Document Client class for a ddata so how can we get the format in serverless dynamodb
we need the data format for a data like a reputation score increse and decrese value on that case we need that data format as like above
we tried with a 'map_put()' function can u suggest any idea?to format the output
Your ask is not clear. If you want to save the item you shared in your question then you simply cal Put with the DocumentClient.
i cant try put becoz i updating the value the output of value will be the above json format so there i am using a update function in DocumentClient

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.