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

Index Bounds Builder tries to build geo bounds using non-geo index

    • Query Integration
    • Fully Compatible
    • ALL
    • v8.0, v7.3, v7.0, v6.0, v5.0
    • Hide

      Create a collection with geo field "loc". Here's an example document to insert:

       

      db.geo.insert({"loc" : { "type" : "Polygon", "coordinates" : [ [ [ 0, 0 ], [ 5, 0 ], [ 5, 5 ], [ 0, 5 ], [ 0, 0 ] ] ] } })

      Create two indexes on the "loc" field, one of type "2dsphere" and one normal index:

       

      db.geo.createIndex({loc: "2dsphere"})
      db.geo.createIndex({loc: 1})

       

      This sample query will hit this assertion error

      db.geo.find({loc: {$not: {$geoWithin: {$geometry: {type: "Polygon", coordinates: [[[-5,-5],[5,-5],[5,5],[-5,5],[-5,-5]]]}}}}}) 

       

      Show
      Create a collection with geo field "loc". Here's an example document to insert:   db.geo.insert({ "loc" : { "type" : "Polygon" , "coordinates" : [ [ [ 0, 0 ], [ 5, 0 ], [ 5, 5 ], [ 0, 5 ], [ 0, 0 ] ] ] } }) Create two indexes on the "loc" field, one of type "2dsphere" and one normal index:   db.geo.createIndex({loc: "2dsphere" }) db.geo.createIndex({loc: 1})   This sample query will hit this assertion error :  db.geo.find({loc: {$not: {$geoWithin: {$geometry: {type: "Polygon" , coordinates: [[[-5,-5],[5,-5],[5,5],[-5,5],[-5,-5]]]}}}}})  
    • 200

      We manage to fail this assertion by trying to build geo bounds for a non-geo index. See steps to reproduce.

            Assignee:
            will.buerger@mongodb.com Will Buerger
            Reporter:
            will.buerger@mongodb.com Will Buerger
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: