Check out example codes for "mongo count". It will help you in understanding the concepts better.

Code Example 1

db.collection.countDocuments( <query>, <options> )

Code Example 2

db.collection.count()

Learn ReactJs, React Native from akashmittal.com