--- title: "Insert Items in NoSQL Table" url: https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/nosql/insert-items/ description: "This page describes the method to perform operations in the NoSQL component." last_updated: 2026-09-09T10:45:38Z service: CloudScale type: general related_links: - name: "Catalyst CloudScale" url: /en/cloud-scale/ - name: "NoSQL Help Documentation" url: /en/cloud-scale/help/nosql/introduction/ - name: "Java SDK Documentation" url: /en/sdk/java/v1/cloud-scale/nosql/insert-items/ - name: "Python SDK Documentation" url: /en/sdk/python/v1/cloud-scale/nosql/insert-items/ - name: "REST API Documentation" url: /en/api/code-reference/cloud-scale/nosql/insert-item/#InsertNewItem repository: name: "Repository" url: https://github.com/catalystbyzoho/zcatalyst-sdk-js --- # Insert Items in NoSQL Table > **Note:** Ensure you have installed the [required package](https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/nosql/overview/#prerequisites) to use this SDK method. Using the `insertItems()` SDK method, you can insert items in a specific NoSQL table after you construct them. > **Notes:** * Catalyst enables you to insert a **maximum of 25 items** in bulk in a NoSQL table with a single SDK operation. * [Learn more about the Catalyst custom JSON format](https://docs.catalyst.zoho.com/en/cloud-scale/help/nosql/working-with-data/introduction/#the-catalyst-custom-json-format). * [Learn more about the supported data types](https://docs.catalyst.zoho.com/en/cloud-scale/help/nosql/working-with-data/introduction/#supported-data-types). ### Insert Items Without Conditions Insert new items into a NoSQL table without any conditions by constructing the items in the Catalyst custom JSON format. This will require you to pass the values for the [partition key and sort key](https://docs.catalyst.zoho.com/en/cloud-scale/help/nosql/components/#table-keys) attributes configured for the table. For example, consider a NoSQL table with the following values:
Attribute Name Attribute Data Type Attribute Value
`fruitName`(**Partition Key**) String Banana
`fruitColor`(map:**fruitProperties**) String Yellow
`fruitType`(map:**fruitProperties**) String Berries
```javascript // Insert a NoSQL item without conditions const plainInsert = await table.insertItems({ // Define the item to be inserted with the partition key fruitName item: NoSQLItem.from({ fruitName: 'Banana', //Provide values for the other attributes of the item fruitProperties: { fruitColor: 'Yellow', fruitType: 'Berries' } }), // Set the return value in the response. Other supported values are "OLD" and "NULL" return: NoSQLReturnValue.NEW }); ``` ### Insert Items With Conditional Functions You can insert attributes in existing items in a NoSQL table using specific conditions that you define in the Catalyst custom JSON format. In this type, the existing data of the table is retrieved and evaluated against the specified condition. The items are inserted only if the evaluation is true. If there is no existing data, the conditions are ignored and the items are inserted. Catalyst supports multiple operators to evaluate conditions. The supported operators are represented as shown below.
Operators Notation
CONTAINS `contains`
NOT_CONTAINS `not_contains`
BEGINS_WITH `begins_with`
ENDS_WITH `ends_with`
IN `in`
NOT_IN `not_in`
BETWEEN `between`
NOT_BETWEEN `not_between`
EQUALS `equals`
NOT_EQUALS `not_equals`
GREATER_THAN `greater_than`
LESS_THAN `less_than`
GREATER_THAN_OR_EQUALS `greater_equal`
LESSER_THAN_OR_EQUALS `less_equal`
AND `AND`
OR `OR`
The example below illustrates this by defining a condition for the data type of the attribute `fruitName` to be **String** in the existing data. If the condition is satisfied, the attribute `taste` with the value "**Sweet**" is added to these items. ```javascript // Insert a NoSQL item with the "attribute_type" function const attrTypeInsert = await table.insertItems({ // Define the item to be inserted item: NoSQLItem.from({ taste: 'Sweet' }), // Define the condition for insert condition: { // The condition specifies that the item should be added if the attribute type is String ("S") function: { // Set the function type function_name: 'attribute_type', // Supply the arguments to the function args: [{ // Set the attribute path attribute_path: ['fruitName'] }, // Set the attribute type NoSQLMarshall.makeString('S') // => { "S": "S" } ] } } }); ``` The following code snippet details further examples of inserting items with conditional functions. ```javascript //Insert a NoSQL Item with the "equals" operator, attribute "name" value equals "apple" const operatorEqInsert = await table.insertItems({ // Define the item to be inserted item: NoSQLItem.from({ taste: 'Sweet' }), // Define the condition for insert condition: { // Set the attribute path attribute: ['name'], // Set the operator based on the operation operator: NoSQLOperator.EQUALS, // Set the value for comparison value: NoSQLMarshall.makeString('apple') // => { "S": "apple" } } }); //Insert a NoSQL Item with "group_operator", attribute "name" is "apple" AND attribute "variety" is "gala" const groupOpInsert = await table.insertItems({ // Define the item to be inserted item: NoSQLItem.from({ taste: 'Sweet' }), // Define the condition for insert condition: { // Set the group operator group_operator: NoSQLConditionGroupOperator.AND, // Supply the group conditions group: [{ // Set the attribute path attribute: 'name', // Set operator based on the operation operator: NoSQLOperator.EQUALS, // Set the value for comparison value: NoSQLMarshall.makeString('apple') // => { "S": "apple" } }, { // Set the attribute path attribute: 'variety', // Set the operator based on the operation operator: NoSQLOperator.EQUALS, // Set the value for comparison value: NoSQLMarshall.makeString('gala') // => { "S": "gala" } } ] } }); //Insert a NoSQL Item with the "begins_with" operator, attribute "name" value begins with "app" const beginsWithInsert = await table.insertItems({ // Define the item to be inserted item: NoSQLItem.from({ taste: 'Sweet' }), // Define the condition for insert condition: { // Set the attribute path attribute: ['name'], // Set the operator based on the operation operator: NoSQLOperator.BEGINS_WITH, // set the value for comparison value: NoSQLMarshall.makeString('app') // => { "S": "app" } } }); ```