update vs set mongoose code example
Example 1: mongoose save or update
// This will create another document if it doesn't exist
findByIdAndUpdate(_id, { something: 'updated' }, { upsert: true });
Example 2: mongoose updatemany example
User.update({"created": false}, {"$set":{"created": true}}, {"multi": true}, (err, writeResult) => {});