[SERVER-260] $pop Created: 25/Aug/09 Updated: 12/Jul/16 Resolved: 07/Sep/09 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Usability |
| Affects Version/s: | None |
| Fix Version/s: | 1.1.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Eliot Horowitz (Inactive) | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
jstests/push.js |
| Comments |
| Comment by Eliot Horowitz (Inactive) [ 15/Sep/09 ] |
|
released in 1.1.0 |
| Comment by Eliot Horowitz (Inactive) [ 07/Sep/09 ] |
|
fixed repl |
| Comment by Aaron Staple [ 07/Sep/09 ] |
|
Current implementation doesn't appear to work correctly with replication. See Pop and PopReverse tests in repltests.cpp |
| Comment by Wouter [ 01/Sep/09 ] |
|
Yeah well, 181 is more about $setting than $unsetting, so I left another comment at http://jira.mongodb.org/browse/SERVER-134. I noticed just now you created another request about $unsetting with array indices at: http://jira.mongodb.org/browse/SERVER-273 so it seems that you're well aware of this feature request |
| Comment by Eliot Horowitz (Inactive) [ 01/Sep/09 ] |
|
wouter: i think you want |
| Comment by Wouter [ 01/Sep/09 ] |
|
What about being able to pop/unset a value in an array based on it's key?! Dot notated key support for $unset { $unset : { 'array.5' : TRUE }} or an array specific operator { $popshift : { array : 5 }} |
| Comment by Eliot Horowitz (Inactive) [ 26/Aug/09 ] |
|
In general I'd rathetr have less operators for simplicity, so if you can re-use 1 that's ideal. But if you think $shift is important, you can add a case and we can probably get to it. |
| Comment by sandstrom [ 26/Aug/09 ] |
|
http://www.mongodb.org/display/DOCS/Updating Nice to see that pop has been implemented. A thought though, wouldn't it be better to use shift for removal of the first element of an array, thats how it works in 99% of programming languages. The current implementation using pop(-1) if it's actually a shift is very unconventional. |