June 2014
Intermediate to advanced
696 pages
38h 52m
English
In Chapter 14, “Manipulating MongoDB Documents from Node.js,” you learned about the find() method of the Collection object. This method returns a Cursor object to the callback function, providing access to the documents. If no query is specified, then all documents are returned, which is rarely what you want. Instead, you typically need a subset of documents that match a certain set of criteria.
To limit the number of documents the find() method finds, you apply a query object that limits the documents that will be returned in the Cursor object.
The code in Listing 15.1 performs a bunch of different queries against the word collection data set described earlier in this chapter. You should already recognize ...
Read now
Unlock full access