mongoose get distinct code example
Example 1: mongodb count distinct
db.collection.distinct('field').length
Example 2: mongodb distinct
Db.collection.distinct('searchField')
db.collection.distinct('field').length
Db.collection.distinct('searchField')