Last updated 8 months ago
/* Example Usage */ const model = ...Someone Model (async () => { await model.findOneAndUpdate({ classNumber: 999 },{ $set:{ name: "Five", surname: "So BeÅ" } },{ $upsert: true }); /* {id:3, name: 'Five', surname: 'So BeÅ', age: null, classNumber: 999, achievements:[]}, */ })();
$upsert
Boolean
$upsert Operator Will Create Operators Like FindOneAndUpdate If The Entered Data Doesn't Exist