Update Item in DYNAMO DB

 

Update item in Dynamo DB using Update item operation in Amazon Dynamo DB connector

Update Item :Edits an existing item’s attributes, or adds a new item to the table if it does not already exist. You can put, delete, or add attribute values. You can also perform a conditional update on an existing item (insert a new attribute name-value pair if it doesn’t exist, or replace an existing name-value pair if it has certain expected attribute values).

You can also return the item’s attribute values in the same Update Item operation using the ReturnValues parameter.

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

Create a project in anypoint studio and configure the listener

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

Update Item

 

Create the payload to pass the primary key on which you want to update

%dw 2.0
output application/json
---
{
"EMPLOYEEID":{"S":"111"}
}

 

Update Item

 

Configure the table name, Key, Update expression and Attributes Values as shown below

Update Items

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

Download Sample Project

  
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
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Anil
Anil
11 months ago

Helloo, Can you share the query component of dynamo db?
I keep getting the error message like below. My understanding is “KeyConditionExpression” is mandatory to be sent in the request to AWS. I have a primary key with string data type.

“Invalid KeyConditionExpression: Syntax error; token: \”‘\”, near: \”(‘ID\””