I use nodeJS sdk to put an element in dynamoDB, element:
{ "eventId": date + '-' + eventName + '-' + eventPurpose, "eventName": eventName, "eventPurpose": eventPurpose, "eventDates": eventDates, "attendees": attendees }
Real code to put an element in dynamoDB:
const params = { TableName: "event", Item: { "eventId": date + '-' + eventName + '-' + eventPurpose, "eventName": eventName, "eventPurpose": eventPurpose, "eventDates": eventDates, "attendees": attendees }, ReturnValues: "ALL_OLD" }; dynamo.put(params, (err, data) => { console.log("coming here"); if (err) { console.log("error : " + JSON.stringify(err)); } console.log("data" + JSON.stringify(data)); cb(null, data); });
The insertion is correct, and the return value is an empty object.
I would like to return the inserted element. I found this doc . But this is only returned if the old value is updated. I could not find other useful information besides this.
Is there any work, or do we just need a request using the get method with the primary key?
source share