HOW TO DO DISTINCT COUNT IN MONGODB code example Example: mongodb count distinct db.collection.distinct('field').length