I have a collection named users.
Documents inside users have a fieldname named usertype.
There are two user types: “Engineering Talent”, “Manager”.
Assuming I have an index that allows searching users by usertype:
What is the best way to query all documents containing a particular usertype?
For multiple documents, you need to use Paginate to fetch a page of results. Map can be used to iterate over each item in a page (or set). Your query should look something like:
The q.lambda_ is an anonymous function that is called for every item in the q.paginate, and the function calls q.get on each reference that it receives.
If you used an index that specified fields in its values definition, the parameter signature of the q.lambda_ would have to match the number of fields.