[SERVER-132] $pushAll several values at once to an array Created: 07/Jul/09 Updated: 12/Jul/16 Resolved: 22/Jul/09 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Usability |
| Affects Version/s: | None |
| Fix Version/s: | 0.9.7 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Wouter | Assignee: | Aaron Staple |
| Resolution: | Done | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
I have noticed though that $push only accepts a single argument. There could be plenty of scenarios where it would be useful to add multiple values at once to the array. The same would go with a $pull modifier (see http://jira.mongodb.org/browse/SERVER-130). For example: db.group.insert({_id:1,text:'user group 1',users:[1,2,3]}); // add some users } ); // remove some users }); |
| Comments |
| Comment by Wouter [ 22/Jul/09 ] |
|
Wow that's awesome. I didn't expect these so soon. I will test them asap. Thanks! |
| Comment by Aaron Staple [ 22/Jul/09 ] |
|
Ok, I've implemented $pushAll/$pullAll, tested in pushall.js and pullall.js. Let me know if you have any difficulties. |