mongoose-history-log
add a collection of events to a schema
usage
schema setup:
var mongoose = ;var mhl = ; var schema = name: String ; ;
This adds a history
property to the schema which is an array of objects:
time: type: Date default: Datenow status: String meta: {}
The meta
property allows you to attach an arbitrartily complex object onto the history
element. When saving the document for the first time, it will automatically add an { status : "created" }
record with the current time.
Adding other events:
var user = mongoosel; user