Details
-
Improvement
-
Resolution: Done
-
Major - P3
-
None
-
Ubuntu 12.04.4 32 bit, Mongodb 2.6.1 , Lenovo thinkcentre.
*Location*: http://docs.mongodb.org/manual/reference/method/cursor.sort/
*User-Agent*: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/34.0.1847.116 Chrome/34.0.1847.116 Safari/537.36
*Referrer*: http://docs.mongodb.org/manual/search/?query=sort
*Screen Resolution*: 1024 x 768
*repo*: docs
*source*: reference/method/cursor.sort
Ubuntu 12.04.4 32 bit, Mongodb 2.6.1 , Lenovo thinkcentre. *Location*: http://docs.mongodb.org/manual/reference/method/cursor.sort/ *User-Agent*: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/34.0.1847.116 Chrome/34.0.1847.116 Safari/537.36 *Referrer*: http://docs.mongodb.org/manual/search/?query=sort *Screen Resolution*: 1024 x 768 *repo*: docs *source*: reference/method/cursor.sort
Description
I have imported the zips.json from mongodb documentation and then ran this query
db.zips.find().sort(
{city:1});
As you notice, the city field is getting replaced with numbers in the result set. What is wrong with this query ?
{ "_id" : "02821", "city" : "02821", "loc" : [ -71.780767, 41.626721 ], "pop" : 246, "state" : "RI" } { "_id" : "04465", "city" : "04465", "loc" : [ -67.844536, 45.951196 ], "pop" : 421, "state" : "ME" }