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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 2.4.0-rc0
    • 2.4.0-rc1
    • None
    • None
    • ALL

    Description

      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?

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: