Saturday, September 29, 2012

mongodb distinct and sort

Its alike javascript.
To sort the result, simply issue sort in the end
db.collections.distinct("fieldname").sort();


No comments: