Update Items in TableAdmin Scope

Note: Ensure you have installed the required package to use this SDK method.

Using the updateItems() SDK method, you can update items in a specific NoSQL table after you construct them. An item can be updated by identifying it using its primary keys. For instance, you can use just the partition key or a combination of the partition key and sort key to identify the required item.

You can then define the update operation type with the appropriate HTTP request method and provide the attributes and values to be updated in the item.

Note: Catalyst enables you to update a maximum of 25 items in bulk in a NoSQL table with a single SDK operation.

The code snippet below illustrates the functionality of the updateItems() SDK method. For this example, the NoSQL table contains the following attributes and values:

Attribute Name Value
fruitName(Partition Key) Apple

To this table we are going to update the values of the taste and color attributes present in the table, along with their paths.

copy
const NoSQLOperator = new NoSQLEnum();
// Update a NoSQL Item identified with the partition key "apple" with its properties attribute updated
const updatedItems = await table.updateItems({
    // Define the partition key value of the item to be updated
    keys: [new NoSQLItem().addString('fruit', 'apple')],
    // Define the attributes to be updated
    update_attributes: [{
        // Specify the type of the update operation
        operation_type: NoSQLUpdateOperationType.PUT,
        // Provide the values for the attribute to be updated
        update_value: NoSQLMarshall.makeMap({
            color: 'Green',
            taste: 'Sour'
        }),
        // Specify the path to the attributes
        attribute_path: ['fruitProperties']
    }]
});

Last Updated 2026-07-02 14:51:41 +0530 IST