{ "name": "mongoose-pureautoinc", "description": "Creating of auto increment fields", "version": "2012.1.0", "author": { "name": "MyLove Company, LLC" }, "dependencies": {}, "devDependencies": { "mongoose": ">=3.0.0", "vows": "0.5.13" }, "keywords": [ "mongoose", "mongo", "mongodb", "auto-increment", "increment", "field" ], "engines": { "node": ">=0.8.0" }, "repository": { "type": "git", "url": "git://github.com/mylovecompany/mongoose-pureautoinc.git" }, "main": "./index.js", "readme": "mongoose-pureautoinc\n====================\n\nThis plugin let you add an `auto increment` field to your schema.\n\n\n## Requirements\n\n- [Node.js](http://nodejs.org/), a server-side JavaScript implementation,\n- [MongoDB](http://www.mongodb.org), a NoSQL database,\n- [Mongoose](http://mongoosejs.com), an elegant Object Document Mapper for MongoDB.\n\n\n## Installation\n\nInstall it from NPM as you always do it with other packages.\n~~~\nnpm install mongoose-pureautoinc\n~~~\n\n\n## Available options\n\n- `model` - required parameter, name of your Mongoose model\n- `field` - name of your field\n- `start` - first value of your field which will be used\n\n\n## How to use\n\nYou can run example using this command:\n~~~\n$ node examples/example.js\n~~~\n\nFirstly, you need to `require` Mongoose and the plugin.\n~~~\nvar mongoose = require('../node_modules/mongoose'),\n Schema = mongoose.Schema,\n db = mongoose.createConnection('127.0.0.1', 'yourDatabaseName'),\n pureautoinc = require('pureautoinc');\n~~~\n\nSecondly, you need to initialize the plugin, define your schema and connect the plugin to it.\n~~~\npureautoinc.init(db);\n\nvar schema = new Schema({\n email: String,\n text: String\n});\n\nschema.plugin(pureautoinc, {\n model: 'Subscriber',\n field: 'recordNum'\n});\n~~~\n\nAfter that you can create your model and use it as you wish.\n~~~\nvar Subscriber = db.model('Subscriber', schema);\n~~~\n\n\n## For developers\nYou should use Git pre-hook to validate your changes. Just copy `pre-commit` file into `./git/hooks/` directory. \nIn order to run tests manually execute `$ vows --spec tests/*` \nIn order to test performance of the plugin execute `$ node benchmarks/benchmark.js`\n\n\n## Copyright\n\n© 2012 [MyLove Company, LLC](http://www.mylovecompany.com). Source code is distributed under [CDDL 1.0](http://opensource.org/licenses/CDDL-1.0) open source license.", "readmeFilename": "README.md", "_id": "mongoose-pureautoinc@2012.1.0", "dist": { "shasum": "97c7346dcbfbe08f4b27efe688ad75cdbf65d850" }, "_from": "mongoose-pureautoinc@", "_resolved": "https://registry.npmjs.org/mongoose-pureautoinc/-/mongoose-pureautoinc-2012.1.0.tgz" }