[DOCS-3364] Comment on: "manual/reference/method/cursor.sort.txt" Created: 07/May/14  Updated: 03/Nov/17  Resolved: 27/May/14

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Improvement Priority: Major - P3
Reporter: Docs Collector User (Inactive) Assignee: Unassigned
Resolution: Done Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

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


Participants:
Days since reply: 9 years, 38 weeks, 1 day ago

 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" }

 Comments   
Comment by Kay Kim (Inactive) [ 27/May/14 ]

Issue is with the zips.json – some of the cities have zipcodes as their values.

Generated at Thu Feb 08 07:45:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.