Answers for "$pull mongoose"

4

$pull mongoose

TemplateDoc.findOneAndUpdate(
    { userId: _id },
    { $pull: { templates: { _id: templateid } } },
    { new: true }
  )
    .then(templates => console.log(templates))
    .catch(err => console.log(err));
Posted by: Guest on May-01-2020
0

mongoose remove document from array

Favorite.updateOne( {cn: req.params.name}, { $pullAll: {uid: [req.params.deleteUid] } } )
Posted by: Guest on April-02-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language