MongoDb Count distinct
db.collection.distinct('field').length
Defiant Dogfish
db.collection.distinct('field').length
Db.collection.distinct('searchField')
db.inventory.distinct( "item.sku", { dept: "A" } )
-- mongodb
db.people.aggregate( [ { $group : { _id : "$status" } } ] )
-- or
db.people.distinct( "status" )
--sql
SELECT DISTINCT(status)
FROM people