Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/panta/mongoose-createdmodified
Mongoose plugin adding created and modified fields to a schema
https://github.com/panta/mongoose-createdmodified
Last synced: 2 months ago
JSON representation
Mongoose plugin adding created and modified fields to a schema
- Host: GitHub
- URL: https://github.com/panta/mongoose-createdmodified
- Owner: panta
- License: mit
- Created: 2012-09-14T09:35:55.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2017-12-01T05:21:45.000Z (about 7 years ago)
- Last Synced: 2024-10-02T02:41:37.689Z (3 months ago)
- Language: CoffeeScript
- Size: 97.7 KB
- Stars: 11
- Watchers: 4
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## About mongoose-createdmodified
[mongoose][] plugin that adds created and modified fields to a mongoose schema.
## Install
npm install mongoose-createdmodified
## Usage
### JavaScript
```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);
```### [CoffeeScript][]
```coffeescript
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.
[mongoose]: http://mongoosejs.com
[CoffeeScript]: http://jashkenas.github.com/coffee-script/
[Node.js]: http://nodejs.org/
[Mocha]: http://visionmedia.github.com/mocha/
[repository]: http://github.com/panta/mongoose-createdmodified