Upsert
Last updated
Last updated
A hybrid of update and insert operation.
Syntax
db.collection_name.update({<restriction query>}, {<update query>}, {"upsert": true})
As shown in the above query syntax, upsert option enables us to do upsert operation, by default this option is false.