number of documents in collection mongod code example Example: see number of documents in mongodb collection db.collection.count()