Covered Query returns null for unset fields

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • 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 }
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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
            Reporter:
            Gar Higgins
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: