Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-19783

Query parser does not correctly handle geonear predicates with other predicates in the same field

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.2
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • Minor Change
    • Query 10 (02/22/16)

      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.

            Assignee:
            benjamin.murphy Benjamin Murphy
            Reporter:
            qingyang.chen Qingyang Chen
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: