mongoose-time
Version:
mongoose timestamps
34 lines (19 loc) • 577 B
Markdown
timestamps for mongoose, populates `created_at` and `updated_at`.
$ npm install mongoose-time
```javascript
var mongoose = require('mongoose')
, Schema = mongoose.Schema
, model = mongoose.model.bind(mongoose)
, timestamps = require('mongoose-time');
var schema = new Schema({}).plugin(timestamps());
var Artist = model('Artist', schema);
```
make sure you edit [db.json](/yields/mongoose-time/blob/master/test/db.json) to set the database the test
should run on.
$ make test
MIT