Skip to content

Mongoose plugin adding created and modified fields to a schema

License

Notifications You must be signed in to change notification settings

Brickflow/mongoose-createdmodified

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About mongoose-createdmodified

mongoose plugin that adds created and modified fields to a mongoose schema.

Install

npm install mongoose-createdmodified

Usage

JavaScript

var mongoose = require('mongoose');
var createdModifiedPlugin = require('mongoose-createdmodified').createdModifiedPlugin;

...

var SampleSchema = new Schema({
  ...
});
SampleSchema.plugin(createdModifiedPlugin, {index: true});
var SampleModel = db.model("SampleModel", SampleSchema);
mongoose = require 'mongoose'
createdModifiedPlugin = require 'mongoose-createdmodified'.createdModifiedPlugin

...

SampleSchema = new Schema
  ...
SampleSchema.plugin createdModifiedPlugin, {index: true}
SampleModel = db.model("SampleModel", SampleSchema)

Bugs and pull requests

Please use the github repository to notify bugs and make pull requests.

License

This software is © 2012 Marco Pantaleoni, released under the MIT licence. Use it, fork it.

See the LICENSE file for details.

About

Mongoose plugin adding created and modified fields to a schema

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CoffeeScript 100.0%