Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/isayme/mongoose-disable-remove
A plugin that will disable remove functions for mongoose models
https://github.com/isayme/mongoose-disable-remove
Last synced: 20 days ago
JSON representation
A plugin that will disable remove functions for mongoose models
- Host: GitHub
- URL: https://github.com/isayme/mongoose-disable-remove
- Owner: isayme
- License: mit
- Created: 2017-04-07T03:24:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-04-10T13:18:53.000Z (over 7 years ago)
- Last Synced: 2024-11-22T21:03:19.532Z (about 1 month ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mongoose-disable-remove
A plugin that will disable remove functions for mongoose models.If a schema enabled this plugin, any call to `Model.remove` & `Document.remove` will return a reject promise or callback(err) if a callback provided.
![travis](https://img.shields.io/travis/isayme/mongoose-disable-remove.svg)
[![Coverage Status](https://coveralls.io/repos/github/isayme/mongoose-disable-remove/badge.svg?branch=master)](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