mongo get count of a collection code example Example: count collection mongodb db.mycollection.count()