I am attempting to utilize mongoDB in order to update the status of an existing document. Despite my backend successfully receiving the routes, the mongoDB update process is not functioning as expected.
router.post('/orders_drivers', function (req, res, next) {
console.log(req.body);
Order.update({_id:objectId(req.body.id)}, {$set: {driver:req.body.driver, driverReq:false}}).then(function(order) {
console.log('UPDATE new driver');
}).catch(next)
});
Upon logging req.body, I can confirm that the received ID and new $set parameters are accurate. However, the command fails to execute. Any suggestions? It is also concerning that no errors are being generated.
Mongo version being used is v4.0.2
All other routes are functioning correctly in my application.