{a: undefined} broken with index

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 2.5.5
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • Fully Compatible
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      > db.foo.insert({})
      > db.foo.find(

      {a:undefined}

      )

      { "_id" : ObjectId("4bfd52c6deec96b27dbb35da") }

      > db.foo.ensureIndex(

      {a:1}

      )
      > db.foo.find(

      {a:undefined}

      )
      > db.foo.find(

      {a:undefined}

      ).explain()
      {
      "cursor" : "BtreeCursor a_1",
      "indexBounds" : [
      [

      { "a" : null }

      ,

      { "a" : null }

      ]
      ],
      "nscanned" : 0,
      "nscannedObjects" : 0,
      "n" : 0,
      "millis" : 0,
      "oldPlan" : {
      "cursor" : "BtreeCursor a_1",
      "indexBounds" : [
      [

      { "a" : null }

      ,

      { "a" : null }

      ]
      ]
      },
      "allPlans" : [
      {
      "cursor" : "BtreeCursor a_1",
      "indexBounds" : [
      [

      { "a" : null }

      ,

      { "a" : null }

      ]
      ]
      }
      ]
      }

              Assignee:
              Benety Goh
              Reporter:
              Mathias Stearn
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: