Other Insert/Update Method
- updateOne(), when used with the upsert: true option.
- updateMany(), when used with the upsert: true option.
- findAndModify(), when used with the upsert: true option.
- findOneAndUpdate(), when used with the upsert: true option.
- findOneAndReplace(), when used with the upsert: true option.
- bulkWrite()
How to use
MongoDB command
db.collection.insertOne(
<document>,
{
writeConcern: <document>
}
)