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 valueR21468772
- 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:
Example 2 - search for a specific integer value:
Search:
- Use the search API: Device Search
- Match the attribute
sub_type
to the value30
- 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:
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 not30
- 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:
Updated 11 months ago