mongoose-archiver

0.1.0 • Public • Published

mongoose-archiver

Archives removed documents to an archive collection

Build Status NPM version

How to install

npm install mongoose-archiver

How to use

Add the plugin to your schema.

var your_schema = new Schema({
    field: String
});
 
your_schema.plugin(require('mongoose-archiver'));

When you remove any document from collection, plugin automatically creates an archive collection and inserts the removed document in it. Later when you need to query any removed documents, you can have the archive model like this:

var archive_model = your_model.archive();
archive_model.find({field: value}, callback);

/mongoose-archiver/

    Package Sidebar

    Install

    npm i mongoose-archiver

    Weekly Downloads

    14

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • vapurfilozofu