from & to: Search Examples
The search operations from
& to
will search for entities where the search attribute value is before or after the specified timestamp.
The search operations from
& to
should only be used to search for date type fields and formatted in ISO-8601.
The search operations from
& to
are inclusive, so values that exactly match the timestamp will be included in the results.
Example 1: Search for entities created after a timestamp
Search:
- Use the search API: Device Search
- Match the attribute
_creationTime
with the value of or after2023-06-08T06:41:38.166Z
- Limit the number of results to 10 per page
- Return the first page
Filter object will look like this:
{
"filter": {
"_creationTime": {
"from": "2023-06-08T06:41:38.166Z"
}
},
"limit": 10,
"page": 0
}
Encoded API call:
Example 2: Search for entities created before a timestamp
Search:
- Use the search API: Device Search
- Match the attribute
_creationTime
with the value of or before2023-06-08T06:41:38.166Z
- Limit the number of results to 10 per page
- Return the first page
Filter object will look like this:
{
"filter": {
"_creationTime": {
"to": "2023-06-08T06:41:38.166Z"
}
},
"limit": 10,
"page": 0
}
Encoded API call:
Example 3: Search for entities created after a timestamp but before another timestamp
Search:
- Use the search API: Device Search
- Match the attribute
_creationTime
with the value between2023-06-07T06:41:38.166Z
and2023-06-08T06:41:38.166Z
inclusive - Limit the number of results to 10 per page
- Return the first page
Filter object will look like this:
{
"filter": {
"_creationTime": {
"from": "2023-06-07T06:41:38.166Z",
"to": "2023-06-08T06:41:38.166Z"
}
},
"limit": 10,
"page": 0
}
Encoded API call:
Updated about 1 year ago