June 2014
Intermediate to advanced
696 pages
38h 52m
English
Another extremely effective method of limiting the resulting data when retrieving documents is to limit which fields are returned. Documents may have a lot of different fields that are useful in some circumstance but not in others. You should consider which fields should be included when retrieving documents from the MongoDB server and only request the ones that are necessary.
To limit the fields returned from a server, use the fields option of the options object. The fields option in an object allows you to either include or exclude fields by setting the value of the document field to 0 for exclude or 1 for include. You cannot mix inclusions and exclusions in the same expression.
For example, to exclude the ...
Read now
Unlock full access