distinct query similar in aggregate mongodb code example Example: mongodb distinct Db.collection.distinct('searchField')