Monday, 4 January 2021

save() in MongoDb/Mongoose

subscriberPlan.save() .then(result => { if (result._id) { res.status(201).json({ Message: 'Plan created!', response: result, Result: true }); } else { res.status(201).json({ Message: 'Plan Not created!', response: result, Result: false }); } }) .catch(err => { if (!err.statusCode) { // err.statusCode = 500; res.status(201).json({ response: err, Message: err.message, Result: false }); } next(err); });

No comments:

Post a Comment

IIS deployment support details

  Node JS - IIS deployment support details node: http://go.microsoft.com/?linkid=9784334 IISNode: https://github.com/azure/iisnode/releases/...