1.2.2 • Published 4 years ago

k-mongoose-soft-delete v1.2.2

Weekly downloads
46
License
MIT
Repository
gitlab
Last release
4 years ago

k-mongoose-soft-delete

An advanced package for softdeleting models with mongoose (also 'find', 'findOne', 'findOneAndUpdate', 'update', 'count')

TODO: Pending add more checks, test and documentation

Installation

The best way to install it is using npm

npm install k-mongoose-soft-delete --save

Loading

var softDelete = require('k-mongoose-soft-delete');

Initialization and Usage

Basic usage (you can see how works better with test:

mongoose.connect('mongodb://localhost/k-mongoose-soft-delete');

Resource = new mongoose.Schema({
    title: {type: String},
    second: {type: String, soft_delete_action: 'null'},
    third:  {type: String, soft_delete_action: 'prefix'}
},{timestamps:true});

Resource.plugin(softDelete);

//When you have a resource
resource.softDelete(function(err){});

Support

This plugin is proudly supported by Kubide hi@kubide.es

1.2.2

4 years ago

1.2.1

5 years ago

1.2.0

6 years ago

1.1.0

6 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago