how to filter distinct fields in mongodb code example
Example 1: mongodb distinct
Db.collection.distinct('searchField')
Example 2: find distinct in mongodb
db.inventory.distinct( "item.sku", { dept: "A" } )
Db.collection.distinct('searchField')
db.inventory.distinct( "item.sku", { dept: "A" } )