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

$within $centerSphere no longer works in versions >2.2.3

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major - P3 Major - P3
    • None
    • 2.2.4
    • Geo
    • None
    • Mac OS X 10.8
    • ALL
    • Hide

      Run a query with $near: { $centerSphere: components on 2.2.4.

      Show
      Run a query with $near: { $centerSphere: components on 2.2.4.

    Description

      Given this query:

      { $query: { $and: [ { $and: [ { user_id: null } ], bin: { $ne: true } } ], value.loc.__loc__: { $within: { $centerSphere: { point: [ 10.2, 20 ], max: 0 } } } }

      This worked fine up until version 2.2.3, which included a change that allows geo queries without a geospacial index. I'm unsure if this is related.

      When we switched to 2.2.3, we started seeing errors on these kinds of queries:

      Wed Apr 24 17:14:28 [conn7] assertion 16483 Couldn't pull any geometry out of $within query: { point: [ 10.2, 20 ], max: 0 } ns:cloudmine_platform_development.app_data query:{ $query: { $and: [ { $and: [ { user_id: null } ], bin: { $ne: true } } ], value.loc.__loc__: { $within: { $centerSphere: { point: [ 10.2, 20 ], max: 0 } } } }, $orderby: { _id: 1 } }

      I went through the Mongo source to find where this error is thrown. It seems that centerSphere is no longer allowed for $within queries (see matcher.cpp L366-409). However, the only reason it's not allowed is because it isn't enumerated in the string of if-elses: if I simply remove the assertion in the 'else' case, the queries work as they used to.

      Attachments

        Activity

          People

            Unassigned Unassigned
            derek@cloudmine.me Derek
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: