Tuesday, 11 December 2018

Best way to update multiple table in express mongoose

Hello guys, i'm working on a small project and what i'm always doing to update multiple tables is for example:Team.findOneAndUpdate(// here i make some changes, function (err, result){if(result){Player.findOneAndUpdate(//some code, function(){PlayerStats.findOneAndUpdate(//some code, function(err,result){return res.json(result);}););}});I want to know if there is another way to do that? is this a bad practice?thank you guys.

Submitted December 11, 2018 at 08:22AM by ayech0x2

No comments:

Post a Comment