Document.prototype.$isDeleted()
Parameters
- [val] «Boolean» optional, overrides whether mongoose thinks the doc is deleted
Returns:
- «Boolean» whether mongoose thinks this doc is deleted.
Getter/setter, determines whether the document was removed or not.
Example:
product.remove(function (err, product) {
product.$isDeleted(); // true
product.remove(); // no-op, doesn't send anything to the db
product.$isDeleted(false);
product.$isDeleted(); // false
product.remove(); // will execute a remove against the db
})
当前内容版权归 mongoosejs 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 mongoosejs .