[SERVER-1509] doing a geo $near search with other fields in the query makes it so the results can't be sorted Created: 29/Jul/10  Updated: 26/Sep/17  Resolved: 15/Nov/10

Status: Closed
Project: Core Server
Component/s: Geo, Querying
Affects Version/s: 1.4.4, 1.5.6
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Jay Marcyes Assignee: Eliot Horowitz (Inactive)
Resolution: Cannot Reproduce Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

os: Windows 7


Participants:

 Description   

creating an index like this:

db.places.ensureIndex(

{ loc : "2d", foo: 1 }

)

then querying on the index like this fails return the expected result:

db.places.find({loc: {$near: [37.775,-122.4183333]},foo: {$gte: 100}}).sort(

{foo:1}

);

if you take out the second part of the query (the foo: {$gte: 100}) but leave in the sort then it returns the expected result.



 Comments   
Comment by Eliot Horowitz (Inactive) [ 15/Nov/10 ]

1.6.4

Comment by Eliot Horowitz (Inactive) [ 15/Nov/10 ]

This is working for me in 1.6 as well.
Can you send a broken script?

Comment by Sasank Reddy [ 15/Nov/10 ]

Would it be possible to get this back-ported to 1.6.X?

Comment by auto [ 15/Nov/10 ]

Author:

{'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}

Message: test for SERVER-1509
/mongodb/mongo/commit/3e55d0d0cc4136dc949cc4325952e93c9ab75306

Comment by Eliot Horowitz (Inactive) [ 15/Nov/10 ]

See attached test.
If you still get - can you send sample code.

Generated at Thu Feb 08 02:57:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.