@seedalpha/mongoose-timestamps
v1.1.10
Published
ensure mongoose models timestamps are up to date
Downloads
5
Readme
mongoose-timestamps
ensure mongoose models timestamps are up to date
Changelog
1.1.0
:
- Add
deletedAt
date field to default schema
Installation
$ npm install git+ssh://[email protected]:seedalpha/mongoose-timestamps.git
Usage
# index.js
var timestamps = require('mongoose-timestamps');
var mongoose = require('mongoose');
var user = new Schema({ name: String });
user.plugin(timestamps);
var User = mongoose.model('User', user);
User.create({ name: 'John' }, function(error, result) {
// result.createdAt
// result.updatedAt
});
Development
$ git clone [email protected]:seedalpha/mongoose-timestamps.git
$ cd mongoose-timestamps
$ npm install
$ npm test
Author
Vladimir Popov [email protected]
License
©2014 Seedalpha