Skip to content
This repository has been archived by the owner on Nov 12, 2018. It is now read-only.

A Mongoose plugin for adding a history column to Mongoose models

License

Notifications You must be signed in to change notification settings

immense/node-mongoose-history

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mongoose History

Mongoose History is a mongoose plugin that adds a history column to your mongoose models

Installation

To install it in your node project, run npm install node-mongoose-history --save.

Usage

Schema = require('mongoose').Schema
history_plugin = require('node-mongoose-history')(Schema)

UserSchema = new Schema
  username:  String
  password:  String
  full_name: String

# To change the name of the history column (default: 'history'):
UserSchema.plugin history, path: 'historical_data'

# To track everything but the password:
UserSchema.plugin history, exclude: 'password'

# To track just the username:
UserSchema.plugin history, exclude: ['password', 'full_name']

Building

To build the Mongoose History coffeescript source, do the following in a node.js-enabled environment:

npm install -g grunt-cli
npm install
grunt

License

Mongoose History is released under the MIT License. Please see the LICENSE file for details.

About

A Mongoose plugin for adding a history column to Mongoose models

Resources

License

Stars

Watchers

Forks

Packages

No packages published