Hi,
is there any difference between
await User.findByIdAndUpdate(
req.user.id,
{
$push: { noteNames: newNote }
},{new: true}
).exec(function (err, DOC) {
if (err) {
return res.status(400).json({ success: false });
}else {
return res.status(200).json({
success: true,
doc: DOC
});
}
});
and
await User.findByIdAndUpdate(
req.user.id,
{
$push: { noteNames: newNote }
}
).exec(function (err) {
if (err) {
return res.status(400).json({ success: false });
}else {
return res.status(200).json({
success: true,
});
}
});
according to mongodb server?
I know that they are different for backend server.
My concern is ram consuming on mongodb.
Does mongodb consume same ram at this two situation?