diff --git a/backend/models/modelToucan.js b/backend/models/modelToucan.js index ffb557605d37f96027558dfb79783d66e43d06f2..6cba87a8024c4a38adb2febcdea41b3cd20d233d 100644 --- a/backend/models/modelToucan.js +++ b/backend/models/modelToucan.js @@ -15,6 +15,16 @@ var toucanSchema = new Schema ({ toucanSchema.index({date:-1},{unique: true}); var toucans = mongoose.model("Toucan",toucanSchema); -await toucans.updateMany( {},{$set: { toucan_id : 'example'} }, { multi: true }); +try{ +await toucans.updateMany( {},{$set: { toucan_id : 'example'} }, { multi: true }, function (err, docs) { + if (err){ + console.log(err) + } + else{ + console.log("Updated Docs : ", docs); + } +}); +} +catch(e) { console.error(e) }; module.exports = toucans; \ No newline at end of file