Skip to main content
Version: v4.6

readingsFilter

readingsFilter#

Use the readingsFilter object to filter a related query for the telemetry items that recorded a reading that matches your telemetry query.

Note: This filter does not return the reading data in the response, only the telemetry items. To return telemetry reading data, see readings query.

The following isolated and empty readingsFilter code example displays the structure and the properties in a readings object:

"readingsFilter": {                  "query": {        //valid simple query object  }                         }

readingsFilter fields table

FieldTypeRequiredDescription
queryObjectRequiredAdd a valid simple query object to query the telemetry items’ readings properties, such as the temperature and timestamp.

The following code example is a readingsFilter object that returns the telemetry items that recorded readings with temperature values greater than or equal to 11℃ and a timestamp value greater than or equal to 09:00, December 1st, 2021:

"readingsFilter": {                  "query": {                        "$and": [                              {                                    "temp": {                                          "$gte": 11                                    }                              },                              {                                    "_ts": {                                          "$gte": "2021-12-01T09:00:00.000Z"                                          }                              }                        ]                  },                  "as": "temp_values"            }

To use a readingsFilter object to filter a $findWithRelated query, see Using a readingsFilter in a findWithRelatedGraph related query.