On Related Object Value

Queries by related object.

Querying objects also support subqueries, which are defined with keywords $inQuery and $notInQuery, and can be applied only to pointer fields.


curl -X GET
   -H "X-Appery-Database-Id: 544a5cdfe4b03d005b6233b9"
   -d 'where={"subtask": {"$inQuery" : { "priority": "High"}}}'
Such a query will return only the objects linked to the objects returned by the subquery. In this example, you get an object that has a pointer to the objects with only a High-value in the priority field.

$notInQuery works inversely: the parent query will return the objects not linked to objects returned by the subquery.

How to get all students collection objects, where the owner column doesn’t reference a user named Alice:

curl -X GET
   -H "X-Appery-Database-Id: 544a5cdfe4b03d005b6233b9"
   -d 'where={"owner": {"$notInQuery" : { "username": "Alice"}}}'