$within $centerSphere no longer works in versions >2.2.3

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Cannot Reproduce
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.2.4
    • Component/s: Geo
    • None
    • Environment:
      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.
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Unassigned
            Reporter:
            Derek
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: