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

indexOnly in explain() is not reported correctly

    • Fully Compatible
    • ALL

      Expected indexOnly:false but it is reported as true.

      skipjack:test> db.foo.find()
      { "_id" : ObjectId("4fa2ad3315f3f440e6aee399"), "a" : 1, "b" : 2 }
      { "_id" : ObjectId("4fa2ad3715f3f440e6aee39a"), "a" : 2, "b" : 2, "c" : 2 }
      
      skipjack:test> db.foo.find({a: 1, b:2, c: {$exists: false}}, {_id: 0, a:1}).explain().indexOnly
      true
      
      skipjack:test> db.foo.find({a: 1, b:2, c: {$exists: false}}, {_id: 0, a:1, c:1}).explain().indexOnly
      false
      
      skipjack:test> db.foo.getIndexKeys()
      [ { "_id" : 1 }, { "a" : 1, "b" : 1 } ]
      
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            siddharth.singh@10gen.com siddharth.singh@10gen.com
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: