count the number of documents in a collections code example Example: mongo count db.collection.countDocuments( <query>, <options> )