Filter methods
Use Ubidots Field filters
Just as the Ubidots API supports requests using Field filters as:
This library also provides a way to construct custom requests that take advantage of said filters.
Filter methods
Filter method | Description | Usage | Arguments | Response |
---|---|---|---|---|
| Applies a filter on a single property of the given |
| A valid property of the given | Depends on the |
| Applies filters on multiple properties of the given |
|
| Depends on the |
Using where
method
where
methodThe example request above can be performed using where
as:
Here:
<entity> = devices
<entity-property> = 'label'
<filter> = startsWith
<filter-value> = 'temp'
<getMethod> = get
Using addRawParams
method
addRawParams
methodThe example request above can be performed using addRawParams
as:
Here:
<entity> = devices
<queryObject> = filterParameters
<getMethod> = get
<queryParam1> = label__startswith
<value1> = 'temp'
Accessing the filters
Note from the API definition that the filters are written in snake-case. Take a look at some of the supported Object filters for example:
contains
contained_by
has_key
In order to maintain the camel-case standard in Javascript, the library's filters are written in camel-case, so the filters above would look like:
contains
containedBy
hasKey
Below you'll find the full list of the filters as defined in the API vs how they look in the library.
Filter in the API | Filter in the library |
---|---|
exact ( = ) |
|
in |
|
Filter in the API | Filter in the library |
---|---|
exact ( = ) |
|
isnull |
|
Filter in the API | Filter in the library |
---|---|
exact |
|
range |
|
gt ( > ) |
|
gte ( |
|
lt ( < ) |
|
lte ( |
|
isnull |
|
Filter in the API | Filter in the library |
---|---|
exact ( = ) (case sensitive) |
|
iexact (case sensitive) |
|
contains |
|
icontains (case insensitive) |
|
startswith |
|
istartswith (case insensitive) |
|
endswith |
|
iendswith (case insensitive) |
|
in (case sensitive) |
|
isnull |
|
Filter in the API | Filter in the library |
---|---|
exact ( = ) |
|
contains |
|
contained_by |
|
overlap |
|
len |
|
isnull |
|
Filter in the API | Filter in the library |
---|---|
contains |
|
contained_by |
|
has_key |
|
has_any_keys |
|
has_keys |
|
isnull |
|
Filter in the API | Filter in the library |
---|---|
exact ( = ) |
|
date |
|
year |
|
quarter |
|
month |
|
week |
|
day |
|
hour |
|
minute |
|
second |
|
isnull |
|
Last updated