1.0.3 • Published 8 years ago
mongoose-created-at v1.0.3
mongoose-created-at
Deprecated. This functionality is built into mongoose now. See
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
createdAtPath
(String) - The path to add the createdAt property. Default:'createdAt'
index
(Mixed) - The indexing options given to this field. See http://mongoosejs.com/docs/api.html#schematype_SchemaType-index. Default:false