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

Covered Query returns null for unset fields

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • 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 }

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: