mongoose-disable-remove
Version:
A plugin that will disable remove functions for mongoose models
26 lines (18 loc) • 784 B
Markdown
# mongoose-disable-remove
A plugin that will disable remove functions for mongoose models.
If a schema enabled this schema, any call to `Model.remove` & `Document.remove` will return a reject promise or callback(err) if a callback provided.

[](https://coveralls.io/github/isayme/mongoose-disable-remove?branch=master)
## Install
> npm install mongoose-disable-remove
## Example
````
var mongoose = require('mongoose')
var disableRemovePlugin = require('mongoose-disable-remove')
var YourSchema = new Schema({
content: String
})
YourSchema.plugin(disableRemovePlugin)
````
## Test
> npm test