The find()
operator creates a cursor to the data. The client can then parse through the data and do calculations on the data for reports purposes. However, with large data sets this is not practical. It makes far more sense for the server to do the calculations and return the result. This can save a considerable amount of unnecessary network traffic. You can however run the count on the cursor without much overhead.
db.mycollection.find().count()
Mongo has two other methods for reporting on data:
- Aggregation
- Map-Reduce