Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
None
-
Ubuntu, MongoDB 3.0.9 version , Using RoboMongo
*Location*: https://docs.mongodb.org/manual/reference/method/
*User-Agent*: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0
*Referrer*: https://docs.mongodb.org/manual/reference/method/setVerboseShell/
*Screen Resolution*: 1440 x 900
*repo*: docs
*source*: reference/method
Ubuntu, MongoDB 3.0.9 version , Using RoboMongo *Location*: https://docs.mongodb.org/manual/reference/method/ *User-Agent*: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 *Referrer*: https://docs.mongodb.org/manual/reference/method/setVerboseShell/ *Screen Resolution*: 1440 x 900 *repo*: docs *source*: reference/method
Description
I have a collection such as:-
{ "_id" : ObjectId("56c2a7320efba7c30cdb139b"), "country_code" : "US", "country_name" : "United States", "region_name" : "Hawaii", "city_name" : "'Aiea", "time_zone" : "-10:00\"\r" }Am doing, db.collection.distinct("countries_name") to get the distinct country_names. Now i want to sort them , but sort is not applicable on distinct.
Error :-TypeError: db.countries_cities.distinct("country_name").sort(
) is not a function (shell):1