Reduce work done for $push:{$each: empty array}

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: 2.8.0-rc3
    • Component/s: Write Ops
    • None
    • Query
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      db.a.update({_id:1}, {$push:{a:{$each:[]}}}, {upsert:1}) //creates a field
      db.a.update({_id:1}, {$push:{a:{$each:[]}}}, {upsert:1}) // produces oplog entry
      db.a.update({_id:1}, {$push:{a:{$each:[2,3]}}})
      db.a.update({_id:1}, {$push:{a:{$each:[]}}}) // no oplog entry
      

            Assignee:
            Backlog - Query Team (Inactive)
            Reporter:
            Scott Hernandez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: