mongodb all records with distinct value code example Example: mongodb distinct Db.collection.distinct('searchField')