see number of documents in mongodb collection

C++
db.collection.count()db.collection.countDocuments( <query>, <options> )
Source

Also in C++: