User GuideAPI Reference
ProductUse CasesResource CenterFAQAbout UsBook a DemoSign Up - It's Free
User Guide

eq & not: Search Examples

The search operation eq will search for entities where the search attribute value exactly matches the search criteria.
The search operation not will search for entities where the search attribute value does not match the search criteria.

In both cases the value can be a string or number as shown in the following examples.

Example 1: Search for a specific string value

Search:

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

Filter object will look like this:

{
  "filter": {
    "_id": {
      "eq": "R21468772"
    }
  },
  "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%0A%20%20%20%20%22_id%22%3A%20%7B%0A%20%20%20%20%20%20%22eq%22%3A%20%22R21468772%22%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 a specific integer value:

Search:

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

Filter object will look like this:

{
  "filter": {
    "sub_type": {
      "eq": 30
    }
  },
  "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%0A%20%20%20%20%22sub_type%22%3A%20%7B%0A%20%20%20%20%20%20%22eq%22%3A%2030%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 3 - search for all values the are different than integer 30 value:

Search:

  • Use the search API: Device Search
  • Match the attribute sub_type that the value is not 30
  • Limit the number of results to 10 per page
  • Return the first page
{
  "filter": {
    "sub_type": {
      "not": 30
    }
  },
  "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%0A%20%20%20%20%22sub_type%22%3A%20%7B%0A%20%20%20%20%20%20%22not%22%3A%2030%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