Skip to content

Instantly share code, notes, and snippets.

@claudiuconstantin
Created August 3, 2018 12:10
Show Gist options
  • Save claudiuconstantin/8b5b7be519d8f84a51d632668fc64108 to your computer and use it in GitHub Desktop.
Save claudiuconstantin/8b5b7be519d8f84a51d632668fc64108 to your computer and use it in GitHub Desktop.
Mongo 3.4+ $out collection
db.collection.aggregate(
[
{ "$addFields": {
"name": { "$concat": [ "$firstName", " ", "$lastName" ] }
}},
{ "$out": "collection" }
]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment