Understanding Query Objects
Throughout this chapter, the various methods all use a query object of some sort or another to define which documents to retrieve from a MongoDB collection. The query object is a standard JavaScript object with special property names that the MongoDB Node.js driver understands. These property names closely match the native queries that you can perform inside the MongoDB client, so you can easily transfer back and forth.
The properties of the query object are called operators because they operate on the data to determine whether a document should be included in the result set. These operators match the values of fields in a document against specific criteria. For example, to find all documents with a count value greater ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access