[SERVER-19783] Query parser does not correctly handle geonear predicates with other predicates in the same field Created: 05/Aug/15  Updated: 28/Sep/16  Resolved: 11/Feb/16

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 3.3.2

Type: Bug Priority: Major - P3
Reporter: Qingyang Chen Assignee: Benjamin Murphy
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-19713 verify() failure when specifying $min... Closed
Documented
is documented by DOCS-8965 Query parser does not correctly handl... Closed
Duplicate
duplicates SERVER-22206 $near query operator should validate ... Closed
duplicates SERVER-17234 geoNear command should return error f... Closed
Backwards Compatibility: Minor Change
Sprint: Query 10 (02/22/16)
Participants:

 Description   

We should allow queries such as

a: { $near: ..., $within: ... }

, but geonear predicates cannot be combined with other predicates in the same field, so we have to do for example,

$and: [ { a: { $near:... } }, { a: { $within: ... } } ]

. Also, ordering shouldn't matter.

In addition, for legacy formats for geonear queries, currently ordering matters and is incorrect in that for example,

a: { $eq: ..., $near: ..., $maxDistance: ... }

would error, but

a: { $near: ..., $eq: ..., $maxDistance: ... }

would ignore the $eq.



 Comments   
Comment by Githook User [ 11/Feb/16 ]

Author:

{u'username': u'benjaminmurphy', u'name': u'Benjamin Murphy', u'email': u'benjamin_murphy@me.com'}

Message: SERVER-19783 Fixed uassert code
Branch: master
https://github.com/mongodb/mongo/commit/9639562e92a6f62360c5828da2883b8ae8dca6b9

Comment by Benjamin Murphy [ 11/Feb/16 ]

All near geo queries ($near, $nearSphere, $geoNear) can no longer have non-geo child or sibling parameters. While this behavior was incorrect to begin with, it should probably be mentioned in the release notes for the next version.

Comment by Githook User [ 11/Feb/16 ]

Author:

{u'username': u'benjaminmurphy', u'name': u'Benjamin Murphy', u'email': u'benjamin_murphy@me.com'}

Message: SERVER-19783 geoNear, near, and nearSphere correctly handle adjacent and child parameters.
Branch: master
https://github.com/mongodb/mongo/commit/5e0ea1eb6b872b35f577104005d2f006d90cf190

Comment by Githook User [ 11/Feb/16 ]

Author:

{u'username': u'benjaminmurphy', u'name': u'Benjamin Murphy', u'email': u'benjamin_murphy@me.com'}

Message: SERVER-19783 Improved error message when near predicate is not first in query.
Branch: master
https://github.com/mongodb/mongo/commit/7fa54380fe62e2f829556fa41c781cdc7bdd7aa6

Comment by Qingyang Chen [ 05/Aug/15 ]

Discovered in SERVER-19713 and should be completed after SERVER-19713 is resolved.

Generated at Thu Feb 08 03:52:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.