Loading...

Query Index

Description

This API enables you to query a NoSQL index in your project and fetch data. The index is referred to by its unique ID.

Request Details

Request URL

POST

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

copy

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

project_id
Numerical
The unique ID of the project

tableIdentifier
Numerical
The unique ID of the table or table name

index_identifier
Numerical
The unique ID of the index

Request Headers

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

Optional Headers

CATALYST-ORG: {org_id}

Environment: Development

Scope

ZohoCatalyst.nosql.POST

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

key_condition json
mandatory
Contains the condition in the format similar to the CRUD operations of items. Only the partition key and sort key conditions can be given. Partition key can only have the “equals” operator. The condition can be partition key = value, or a group with partition key equals condition and the sort key condition. Refer to the full list of supported operators.
required_attributes json
optional
List of attributes to be returned.
consistent_read json
optional
Declares if the read has to be done from master or slave. If set to false, it is queried from the slave. Accepted values: true, false.
other_condition json
optional
These are conditions that are applied over the retrieved data. The response is sent after these conditions are applied.
forwardScan json
optional
This is used to indicate if the query has to be done in ascending or descending order.
startKey json
optional
This is used for pagination purposes to fetch the next set of data items.
additional_sort_key json
optional
This is used to indicate if the query is made against the table with additional sort keys. This contains the additional sort key attribute names.
limit json
optional
This indicates the maximum count of items that should be returned.

Response Details

The response will return the status of the query operation, as well as the items that are fetched according to the conditions set in the query.

Sample Request
copy

curl -X POST
https://api.catalyst.zoho.com/baas/v1/project/4000000006007/nosqltable/3376000003171728/index/786387162881/item/query
-H “Authorization: Zoho-oauthtoken 1000.910*************************16.2f*************************57”
-H “Content-Type:application/json”
-d -d ‘{ key_condition:{ partition_key:{ “S”:“Country” }, sort_key:{ “N”:“EmpID” }, } required_attributes: { “EmpID”, “FirstName”, “LastName”, “PriorExperience” }, consistent_read: “true” }’

Sample Response
copy

{ “status”: “success”, “data”: { fetched_data:{ “item”: { “EmpID”: { “N”: “10999” }, “FirstName”:{ “S”: “Paul” }, “LastName”:{ “S”: “Smith” }, “PriorExperience”:{ “BOOL”: false } } } } }