Put or Create item

 

Put or Create item in Dynamo DB using put item operation

Put Item: Creates a new item, or replaces an old item with a new item. If an item that has the same primary key as the new item already exists in the specified table, the new item completely replaces the existing item. You can perform a conditional put operation (add a new item if one with the specified primary key doesn’t exist), or replace an existing item if it has certain attribute values

Please refer below url for more details for put item operation

https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html

Prerequisite: you should have access to create item in Dynamo DB

Create a project in anypoint studio and configure the listener

Drag and drop the Put Item Operation from mule palette and configure the Amazon Dynamo DB Connector

Put or Create item
 
Create the payload to create item in dynamo db

%dw 2.0
output application/json
---
{
  "EMPLOYEEID": {"S": "111"},
  "FIRSTNAME": {"S": "FIRST"},
  "LASTNAME": {"S": "LAST"},
  "EMAIL": {"S": "[email protected]"},
  "EMPLOYEETYPE": {"S": "PERMANENT"}
}

 

 

Configure the table name and item

 

Deploy and test the project, Item created successfully In Dynamo DB

Download sample file

  
Thank you for taking out time to read the above post. Hope you found it useful. In case of any questions, feel free to comment below. Also, if you are keen on knowing about a specific topic, happy to explore your recommendations as well.
 
For any latest updates or posts on our website, you can follow us on LinkedIn. Look forward to connecting with you there.


Share this:
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments