-
Type: New Feature
-
Resolution: Done
-
Priority: Minor - P4
-
None
-
Affects Version/s: 1.3.3
-
Component/s: Write Ops
-
None
-
Query
Appends a string to a string field.
If the string field does not exist in the document, it just sets it.
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"
- related to
-
SERVER-829 Add $replace Modifier Operation
- Closed