The following is a list of different types of data queries supported by servIoTicy:

geodistance: Search for Updates within a given distance of a given coordinate. Incompatible with GeoBoundingBoxRequires a location channel (in GeoJson format) to exist, which will be used to keep the location of the sensor updates.

Example payload:

{
    "geodistance": true,
    "geodistancevalue": 300,
    "pointlat": 43.15,
    "pointlon": 15.43,
    "geodistanceunit": "km"
}

geoboundingbox: Search for Updates within a geo fence. Incompatible with GeoDistanceRequires a location channel  (in GeoJson format) to exist, which will be used to keep the location of the sensor updates.

Example payload:

{
    "geoboundingbox": true,
    "geoboxupperleftlat": 15.43,
    "geoboxupperleftlat": 43.15,
    "geoboxbottomrightlat": 47.15,
    "geoboxbottomrightlon": 15.47
}    

timerange: Search for Updates with a lastUpdate field value within a range of timestamps.

Example payloads:

{ “timerange”: true, “rangefrom”: 1396859660, “rangeto”: 1396859760 }

{
    "timerange": true,
    "rangeto": 1396859760
}    

{
    "timerange": true,
    "rangefrom": 1396859660,
}    

numericrange: Search for Updates with a given field value within a range of values.

Example payloads:

{
    "numericrange": true,
    "rangefrom": 13,
    "rangeto": 17,
    "numericrangefield": "channels.age.current-value"
}

{
    "numericrange": true,
    "rangefrom": 13,
    "numericrangefield": "channels.age.current-value"
}

{
    "numericrange": true,
    "rangeto": 17,
    "numericrangefield": "channels.age.current-value"
}

match: Search for Updates that match in any of its fields with the terms listed (any of them)

Example payloads:

{
    "match": true,
    "matchfield": "channels.name.current-value",
    "matchstring": "Peter John",
}

Example of complex query that restricts:

Corresponding payload:

{
    "numericrange": true,
    "rangefrom": 13,
    "rangeto": 17,
    "numericrangefield": "channels.age.current-value",

    "timerange": true,
    "rangefrom": 1396859660,

    "match": true,
    "matchfield": "channels.name.current-value",
    "matchstring": "Peter John",

    "geoboundingbox": true,
    "geoboxupperleftlat": 15.43,
    "geoboxupperleftlat": 43.15,
    "geoboxbottomrightlat": 47.15,
    "geoboxbottomrightlon": 15.47
}