June 2014
Intermediate to advanced
696 pages
38h 52m
English
Most of the time, you use a library such as the native MongoDB driver or Mongoose to access documents in a collection. However, there may be times when you need to look at documents inside the MongoDB shell.
The MongoDB shell provides full querying functionality to find documents in collections, using the find(query) method on the collection object. The optional query parameter specifies a query document with fields and values to match documents against in the collection. The documents that match the query are removed from the collection. Using the find() method with no query parameter returns all documents in the collection.
For example, the following lines of code first query every item in the collection and ...
Read now
Unlock full access