count all documents in collection mongodb example Example: mongo count db.collection.countDocuments( <query>, <options> )