{ $pull: { : , : , ... } } // The $pull operator removes from an existing array all instances // of a value or values that match a specified condition.
TemplateDoc.findOneAndUpdate( { userId: _id }, { $pull: { templates: { _id: templateid } } }, { new: true } ) .then(templates => console.log(templates)) .catch(err => console.log(err));
{ $pull: { : , ... } }