1.0.3 • Published 8 years ago

mongoose-created-at v1.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

mongoose-created-at

Deprecated. This functionality is built into mongoose now. See

mongoose docs

Dependency Status Dependency Status Code Climate Build Status Coverage Status

Another mongoose created-at module. Gives you some options to change the path and indexing object.

Usage

'use strict';

var mongoose = require('mongoose');
var Schema   = mongoose.Schema;

var MySchema = new Schema({
  name: String
});

MySchema.plugin(require('mongoose-created-at'));

To pass in options:

MySchema.plugin(require('mongoose-created-at'), {
  createdAtPath: 'createdAt',
  index: false
});

Options