isNull & isNotNull: Search Example

The search operations isNull & isNotNull will search for entities where the search attribute value is null/not existent or is not null.

Example 1: Search for entities with a value that is null or non existent

Search:

  • Use the search API: Device Search
  • Match the attribute sub_type with the value of null
  • Limit the number of results to 10 per page
  • Return the first page

Filter object will look like this:

{
  "filter": {   
    "sub_type": {
      "isNull": true
    }
  },
  "limit": 10,
  "page": 0
}

Encoded API call:

https://api.dev.example.biot-med.com/device/v2/devices?searchRequest=%7B%0A%20%20%22filter%22%3A%20%7B%20%20%20%0A%20%20%20%20%22sub_type%22%3A%20%7B%0A%20%20%20%20%20%20%22isNull%22%3A%20true%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%20%20%22limit%22%3A%2010%2C%0A%20%20%22page%22%3A%200%0A%7D

Example 2: Search for entities with a value that is not null

Search:

  • Use the search API: Device Search
  • Match the attribute sub_type with a value that is not null
  • Limit the number of results to 10 per page
  • Return the first page

Filter object will look like this:

{
  "filter": {   
    "sub_type": {
      "isNotNull": true
    }
  },
  "limit": 10,
  "page": 0
}

Encoded API call:

https://api.dev.example.biot-med.com/device/v2/devices?searchRequest=%7B%0A%20%20%22filter%22%3A%20%7B%20%20%20%0A%20%20%20%20%22sub_type%22%3A%20%7B%0A%20%20%20%20%20%20%22isNotNull%22%3A%20true%0A%20%20%20%20%7D%0A%20%20%7D%2C%0A%20%20%22limit%22%3A%2010%2C%0A%20%20%22page%22%3A%200%0A%7D