[SERVER-743] $append modifier Created: 13/Mar/10 Updated: 06/Dec/22 Resolved: 29/Jun/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Write Ops |
| Affects Version/s: | 1.3.3 |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Minor - P4 |
| Reporter: | Slavi Pantaleev | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Query
|
||||||||
| Participants: | |||||||||
| Description |
|
Appends a string to a string field. db.collection.insert({_id: "test", message: "Mongo"}); //message is now "Mongo" db.colection.update({_id: "test"}, {$append: {message: "DB"}, false, false}; //message is now "MongoDB" db.colection.update({_id: "test"}, {$append: {anotherMessage: "NoSQL"}, false, false}; //anotherMessage is now "NoSQL" |
| Comments |
| Comment by Asya Kamsky [ 29/Jun/19 ] |
|
You can see some examples here. |
| Comment by Kevin J. Rice [ 15/Mar/13 ] |
|
See also: https://jira.mongodb.org/browse/CS-6195 Ability to append binary data to a binary object. |
| Comment by Remon van Vliet [ 07/Dec/10 ] |
|
I think having a ton of modifiers with very specific use cases should be avoided. I don't think this is something that is really lacking, and it can be done with findAndModify() |