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

Covered Query returns null for unset fields

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • ALL
    • Hide
      db.widget.save({a:1})
      db.widget.find({a:1}, {b:1, _id:0})
      { }
      db.widget.ensureIndex({a:1, b:1})
      db.widget.find({a:1}, {b:1, _id:0})
      { "b" : null }
      
      Show
      db.widget.save({a:1}) db.widget.find({a:1}, {b:1, _id:0}) { } db.widget.ensureIndex({a:1, b:1}) db.widget.find({a:1}, {b:1, _id:0}) { "b" : null }

      A covered query returns null instead of unset for values not present in a record. This means the result of the query can change depending on whether it's covered by an index or not.

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            edgar.j.higgins@gmail.com Gar Higgins
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: