[SERVER-7407] Adjust the behavior of $unset for nested arrays Created: 18/Oct/12  Updated: 09/Jul/16  Resolved: 27/Jul/13

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Alberto Lerner Assignee: Alberto Lerner
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-7174 Implement all update() operators Closed
Related
related to SERVER-4781 replica set initial sync failure when... Closed
Backwards Compatibility: Major Change
Operating System: ALL
Participants:

 Description   

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.


Generated at Thu Feb 08 03:14:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.