Loading...

NoSQL

Catalyst NoSQL is a fully managed non-relational, NoSQL data storage feature that enables you to store the semi-structured, unstructured, and disparate data of your applications. Catalyst supports document-type data storage in the key-value pair based JSON format.

The Catalyst NoSQL APIs enable you to perform CRUD operations on your NoSQL tables. You can insert, update, delete, or fetch items, as well as execute queries on a table or a table’s index.

Insert Item

Description

This API enables you to insert a new item in a NoSQL table in your project. The table is referred to by its unique ID or name.

You can insert an item with or without specifying any conditions by passing the data in the Custom JSON format.

Note: The table must already be created. You can create a NoSQL table from the console.

Request Details

Request URL

POST

{api-domain}/baas/v1/project/{{project_id}}/nosqltable/{{table_identifier}}/item

copy

api-domain
URL
The DC-specific domain to access Catalyst API

project_id
Numerical
The unique ID of the project

table_identifier
Numerical
The unique ID of the table or table name

Request Headers

Authorization: Zoho-oauthtoken {oauth_token}
Content-Type: application/json

Optional Headers

CATALYST-ORG: {org_id}

Environment: Development

Scope

ZohoCatalyst.nosql.item.INSERT

Note: This operation can also be executed with Catalyst user authentication permissions using Catalyst SDKs. Refer to the Catalyst API Prerequisites section for details.

Request JSON Properties

item json
mandatory
Contains the main data to be inserted in the table. The item must be inserted in the Custom JSON format. Specify the partition key, if the table was configured with a simple primary key. Specify both the partition key and sort key, if the table was configured with a composite primary key.
condition json
optional

The existing data of the table is retrieved and evaluated against this 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. There are three ways to initialize a condition:

functions json
mandatory (if specifying condition)
The two built-in functions are: attribute_exist, which can be used to check for the presence of an attribute, and attribute_type, which can be used to check if the given attribute name belongs to the given type.

operator, attribute, value json
optional
To perform direct comparison operations. Supported operators: contains, not_contains, begins_with, ends_with, in, not_in, between, not_between, equals, not_equals, greater_than, less_than, greater_equal, less_equal.

group, group operator json
optional
To combine two or more conditions. Supported group operators: and, or.

negate json
optional
To negate the result of the conditions.

Response Details

The response will return the status of the insert operation, as well as the details of the item inserted such as the table_name, partition_key and sort_key, if configured.

Sample Request
copy

curl -X POST
https://api.catalyst.zoho.com/baas/v1/project/4000000006007/nosqltable/3376000003171728/item
-H “Authorization: Zoho-oauthtoken 1000.910*************************16.2f*************************57”
-H “Content-Type:application/json”
-d ‘{ “item”: { “EmpID”: { “N”: “10999” }, “FirstName”:{ “S”: “Paul” }, “LastName”:{ “S”: “Smith” }, “PriorExperience”:{ “BOOL”: false }, “Location”: { “M”: { “Country”: { “S”: “USA” }, “City”: { “S”: “New York” } } } } }’

Sample Response
copy
{
"status": "success",
"data": {
    "table_name": "employeeDetails",
    "project_details": {
        "id": 4000000006007,
        "project_name": "EmpDatabase",
        "project_type": "Live"
    }
}
}