Skip to content

mstdokumaci/mongoose-archiver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);

About

Archives removed documents to an archive collection

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published