validate distinct values in mongodb insert code example Example: mongodb distinct Db.collection.distinct('searchField')