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

Compound 2d sphere indexes in 2.4 don't support array fields?

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.4.0-rc1
    • Affects Version/s: 2.4.0-rc0
    • Component/s: None
    • Labels:
      None
    • ALL

      I tried inserting the following document:

      {
      "_id" : ObjectId("510c1f0a9dcaa36340e0c983"),
      "location" :

      { "type" : "Point", "coordinates" : [ -122, 37 ] }

      ,
      "friend_ids" : [
      123,
      456
      ]
      }

      Added the following index:
      db.updates.ensureIndex(

      { friend_ids: 1, location: '2dsphere' }

      )

      But when I query for the following, nothing is returned:
      db.updates.find({ friend_ids: 123, location: {$near:

      { type: "Point", coordinates: [-122, 37]}

      }})

      It works for non-array fields. Is this by design or a bug?

            Assignee:
            hari.khalsa@10gen.com hari.khalsa@10gen.com
            Reporter:
            fbjork Fredrik Björk
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: