Model.findByIdAndDelete()
Parameters
id «Object|Number|String» value of
_id
to query by[options] «Object» optional see
Query.prototype.setOptions()
[options.strict] «Boolean|String» overwrites the schema’s strict mode option
[callback] «Function»
Returns:
- «Query»
Issue a MongoDB findOneAndDelete()
command by a document’s _id field. In other words, findByIdAndDelete(id)
is a shorthand for findOneAndDelete({ _id: id })
.
This function triggers the following middleware.
findOneAndDelete()
当前内容版权归 mongoosejs 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 mongoosejs .