Hello, I would like to know how to do it so that once the update of the duration is over, it will be when I show the updated duration.
Recipe.insertMany(recipes)
.then(recipes => {
console.log('${recipes.length} inserted');
Recipe.findOneAndUpdate({ title: "Rigatoni alla Genovese" },{ duration: 310})
.then(updated => next(updated))
.then(updated => {
console.log(updated);
});
})
.catch(err => {
console.log("Error updating db", err);
});