can i use $pull in mongoose code example
Example: $pull mongoose
TemplateDoc.findOneAndUpdate(
{ userId: _id },
{ $pull: { templates: { _id: templateid } } },
{ new: true }
)
.then(templates => console.log(templates))
.catch(err => console.log(err));