how to get the count of documents in mongodb without using $count code example Example: mongo count db.collection.countDocuments( <query>, <options> )