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

Cannot use compound of 2d and multikey index

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.8.0
    • Affects Version/s: 1.6.5, 1.7.4
    • Component/s: Geo, Index Maintenance
    • None
    • Environment:
      Debian Linux, x64

      2 examples with unexpected results:

      db.test.insert({
      point:[1,10],
      tags:[

      {k:'key',v:'value'}

      ,

      {k:'key2',v:123}

      ]
      })

      db.test.insert({
      point:[1,10],
      tags:

      {k:'key',v:'value'}


      })

      db.test.ensureIndex(

      {point:"2d","tags.k":1,"tags.v":1}

      )
      db.test.find({
      point:{"$within":{"$box":[[0,0],[12,12]]}},
      "tags.k":"key"
      })

      Only 1 result:
      { "_id" : ObjectId("4d373f753ffe71e78a71bfc0"), "point" : [ 1, 10 ],
      "tags" :

      { "k" : "key", "v" : "value" }

      }

      2)
      db.test.drop()
      db.test.insert({p:[1112,3473],t:[

      {k:'a',v:'b'}

      ,

      {k:'c',v:'d'}

      ]})
      db.test.ensureIndex(

      {p:'2d','t.k':1,'t.v':1}

      ,

      {min:0,max:10000}

      )
      db.test.find(

      {p:[1112,3473],'t.k':'a'}

      )
      No result.

      Some discussion here: http://groups.google.com/group/mongodb-user/browse_thread/thread/8fa375ba78081b2c/fd9967f89ff758da

        1. geog.js
          0.6 kB
        2. geoh.js
          0.8 kB

            Assignee:
            greg_10gen Greg Studer
            Reporter:
            andi Andreas Kalsch
            Votes:
            8 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: