O'Reilly logo

MongoDB Cookbook - Second Edition by Amol Nayak, Cyrus Dasadia

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Viewing collection stats

Perhaps one of the interesting statistics from an administrative purpose when it comes to the usage of storage, the number of documents in collection possibly to estimate the future space, and memory requirements based on the growth of the data is to get a high level statistics of the collection.

Getting ready

To find the stats of the collection we need to have a server up and running and a single node is what should be okay. Refer to the Installing single node MongoDB in Chapter 1, Installing and Starting the Server for information on how to start the server. The data on which we would be operating needs to be imported in the database. The steps to import the data are given in the recipe Creating Test Data in Chapter 2 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required