Update Item
Description
This API enables you to update an item from the existing data in a NoSQL table in your project. The table is referred to by its unique ID or name.
You can pass the attributes to be updated with or without specifying any conditions in the Custom JSON format.
Request Details
Request URL
{api-domain}/baas/v1/project/{{project_id}}/nosqltable/{{table_identifier}}/item
Request Headers
Authorization: Zoho-oauthtoken {oauth_token}
Content-Type: application/json
Optional Headers
CATALYST-ORG: {org_id}
Environment: Development
Scope
ZohoCatalyst.nosql.item.UPDATE
Request JSON Properties
Denotes the attribute to be updated along with its value. The update can be of two types: PUT (to add a new attribute within the item) and DELETE (to remove an attribute from the item). The attribute_path indicates the path within the item where the actual operation is to be done. The value to be updated can be of two types:
There are four functions that can be used:
if_not_exists - Checks the existence of the attribute and declares a value if it is not present.
append_list - Appends data to a list
add - Adds a value along with existing value or adds an element in a set
reduction - Subtracts a value from existing value or removes an element in a set.
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:
Response Details
The response will return the status of the insert operation, as well as the details of the item updated such as the table_name, partition_key and sort_key, if configured.
curl -X PUT
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 ‘{
keys:{
partition_key:{
“S”:“Country”
},
sort_key:{
“N”:“EmpID”
},
}
update_attributes:{
“item”: {
“EmpID”: {
“N”: “10999”
},
“FirstName”:{
“S”: “Paul”
},
“LastName”:{
“S”: “Smith”
},
“PriorExperience”:{
“BOOL”: false
},
“Location”: {
“M”: {
“Country”: {
“S”: “USA”
},
“City”: {
“S”: “New York”
}
}
}
}
}
}’
{
"status": "success",
"data": {
"table_name": "employeeDetails",
"project_details": {
"id": 4000000006007,
"project_name": "EmpDatabase",
"project_type": "Live"
}
}
}
Yes
No
Send your feedback to us