Vermongo Mongoose Plugin
Keeps history for mongoose documents.
Spec for Vermongo [link]
Installation
npm install mongoose-vermongo
Usage
var mongoose = ;var vermongo = ;mongoosePromise = ; var Schema = mongooseSchema; var pageSchema = title : type : String required : true content : type : String required : true path : type : String required : true tags : String lastModified : Date created : Date;pageSchema; mongoose;mongooseconnection; mongooseconnection;
Which will result in two Collections,
pageschemas
There will be 0 records
pageschemas.vermongo
There will be 3 records:
"_id" : "_version" : 1 "_id" : "title" : "test" "content" : "foobar" "path" : "lala" "_version" : 1 "tags" : "a" "b" /* 2 */ "_id" : "_version" : 2 "_id" : "title" : "test 2" "content" : "foobar" "path" : "lala" "_version" : 2 "tags" : "a" "b" /* 3 */ "_id" : "_version" : 3 "_id" : "_version" : -1 "tags" :