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

Adjust the behavior of $unset for nested arrays

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Write Ops
    • None
    • Major Change
    • ALL

      Currently, the semantics of $unset is ambiguous when arrays are involved. For instance, the following returns

      {a:[]}

      start:

      { a : [] }

      update: { $unset :

      { "a.0" : 1 }

      }

      But the following returns

      {a:[null]}

      start:

      { a : ['abc'] }

      update: { $unset :

      { "a.0" : 1 }

      }

      We'd like the $unset semantics to be that of setting a position to null, when the target of the unset is an array's element.

            Assignee:
            alerner Alberto Lerner
            Reporter:
            alerner Alberto Lerner
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: