MongoDB count() Method
Use db.collection.count() method to count the number of documents available in a collection.
Example – Count Total Documents
Use the following command from mongo shell to count the number of available documents in users collection.
Example – Count with Find
You can also use count() function with other functions like find.