mongoose unhandled error in promise

0

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);
  });
    
asked by Francisco Manrique de lara 27.06.2018 в 16:41
source

0 answers