1// This will create another document if it doesn't exist
2findByIdAndUpdate(_id, { something: 'updated' }, { upsert: true });
1// SAVE NEW OR UPDATE EXISTING COLLECTION
2AnnoucementTagsModel.findOneAndUpdate({_id: announcementId}, newAnnoucementTags, {upsert: true}, function (err, doc) {
3 if (error) throw new Error(error);
4 console.log("succesfully saved");
5});