The GET /dataVectors/
API is used for retrieving all information from the platform. It's criteria
parameter enables afiltering by all kinds of specific information.
For example, the following query could be used to find only information about data vectors with an attribute 'type' set to 'thermometer'
GET /dataVectors/
?include=["id","temperature"]
&criteria={"type":{"equals":"thermometer"}}
Return:
[
{
"id": "warehouse_thermometer",
"temperature": 45
},
{
"id": "outsite_thermometer",
"temperature": 67.34
}
]
However, there are many more filters than can be applied to a specific attribute.
Returns all data vectors that have an attribute that is equal to a specified value
{
"type": {
"equals": "thermometer"
}
}
Returns all data vectors that have an attribute that is not equal to a specified value
{
"type": {
"notequals": "thermometer"
}
}
Returns all data vectors that do have an attribute with the specified key, regardless of its value
{
"temperature": {
"exists": true
}
}
Returns all data vectors that do have an attribute with the specified key, regardless of its value
{
"temperature": {
"exists": false
}
}
Returns all data vectors that have an attribute with a value in a specified set of values
{
"temperature": {
"in": [
44,
45,
46
]
}
}
Or
{
"type": {
"in": [
"thermometer",
"humidifier"
]
}
}
Returns all data vectors that have an attribute with a value that is not contained in a specified set of values
{
"temperature": {
"notin": [
44,
45,
46
]
}
}
There are two syntatical shortcuts for 'equals' and 'in' style queries.
This query:
{
"type": {
"equals": "thermometer"
}
}
Could be more easily written like this:
{
"type": "thermometer"
}
This query:
{
"type": {
"in": [
"thermometer",
"humidifier"
]
}
}
Could be more easily written like this:
{
"type": [
"thermometer",
"humidifier"
]
}