Skip to content

Get by id

This API used to get data using ID(primary-key) provided in the collection.

Predefined Query Param keys:

select

To get selected values in the response, give key name in the select key. Add multiple key comma separate.

Generated url:

/get-by-id/1/?select=first_name,last_name
getById-Select

deep

deep - get deep data. It supports s_key, t_col, skip, t_key, isMultiple, select, limit, sort, find. s_key - Source key - define source table key name which have relation with target collection.
t_col - Target collection - define target collection name.
t_key - Target key - target collection's key which have relation with the source key.
skip - Skip given count data.
isMultiple - Get multiple matching relation data.
select - If we add '-' before any key name it will not get in response.
limit - Get only given number data.
sort - Sorting with given key name.
find - To find particular we can use it.

{
  deep: [
    {
      "s_key": "customer_id",
      "t_col": "products",
      "t_key": "owner_id",
      "skip": 1,
      "isMultiple": true,
      "select": "-status",
      "limit": 5,
      "sort": "name",
      "find": {
        "category_id": {
          "$in": [
            56572,
            89355
          ]
        }
      }
    }
  ]
}
Generated url:
/get-by-id/1/?select=first_name,last_name&deep=[{"s_key":"customer_id","t_col":"products","t_key":"owner_id","skip":1,"isMultiple":true,"select":"-status","limit":5,"sort":"name","find":{"category_id":{"$in":[56572,89355]}}}]
getById-deep-1

Primary key

By-default get-by-id API got data of default primary-key.
Here we can define the primary-key.
In below request the default primary-key is 'id', but we change it to 'owner_id' on the fly.
Now we got the result as per requested on given 'owner_id'.

Generated url:

/get-by-id/20/owner_id
primary-key