findWithRelated
Using a readingsFilter in a findWithRelated query#
The $findWithRelated query looks up related items in multiple named user collections—add a readingsFilter object in a $findWithRelated query to filter for the telemetry items that have recorded a reading that matches your 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.
You can add a readingsFilter object to either the parent, related, or relatedFilter sections of a $findWithRelated query:
- Parent: If you want to return telemetry items with readings that match your telemetry query and a separate relationship query, see Using a readingsFilter in the parent section of a findWithRelated query.
- Related or relatedFilter: If you want to return related items based on a relationship to telemetry items with readings that match your telemetry query, use one of the following options:
- related: Returns all the related items in the collection and if a related item has a child telemetry item reading that matches your query, it appends to the related item. For more information, see Using a readingsFilter in the related section of a $findWithRelated query.
- relatedFilter: Returns only the related items that have child telemetry items that match your query. For more information, see Using a readingsFilter in the relatedFilter section of a $findWithRelated query
For more information on $findWithRelated queries, see $findWithRelated query. For more information on readingsFilter objects, see readingsFilter.