Files
biomedjs/node_modules/mongoose/package.json

71 lines
11 KiB
JSON
Raw Normal View History

2014-09-14 07:04:16 -04:00
{
"name": "mongoose",
"description": "Elegant MongoDB object modeling for Node.js",
"version": "3.6.15",
"author": {
"name": "Guillermo Rauch",
"email": "guillermo@learnboost.com"
},
"keywords": [
"mongodb",
"document",
"model",
"schema",
"database",
"odm",
"data",
"datastore",
"query",
"nosql",
"orm",
"db"
],
"dependencies": {
"hooks": "0.2.1",
"mongodb": "1.3.11",
"ms": "0.1.0",
"sliced": "0.0.3",
"muri": "0.3.1",
"mpromise": "0.2.1",
"mpath": "0.1.1",
"regexp-clone": "0.0.1"
},
"devDependencies": {
"mocha": "1.8.1",
"node-static": "0.5.9",
"dox": "0.3.1",
"jade": "0.26.3",
"highlight.js": "7.0.1",
"markdown": "0.3.1",
"promises-aplus-tests": ">= 1.0.2",
"tbd": "0.6.4"
},
"directories": {
"lib": "./lib/mongoose"
},
"scripts": {
"test": "make test"
},
"main": "./index.js",
"engines": {
"node": ">=0.6.19"
},
"bugs": {
"url": "https://github.com/learnboost/mongoose/issues/new",
"email": "https://groups.google.com/group/mongoose-orm"
},
"repository": {
"type": "git",
"url": "git://github.com/LearnBoost/mongoose.git"
},
"homepage": "http://mongoosejs.com",
"readme": "## What's Mongoose?\n\nMongoose is a [MongoDB](http://www.mongodb.org/) object modeling tool designed to work in an asynchronous environment.\n\n## Documentation\n\n[mongoosejs.com](http://mongoosejs.com/)\n\n## Try it live\n<a href=\"https://runnable.com/#learnboost/mongoose/code.js/launch\" target=\"_blank\"><img src=\"https://runnable.com/external/styles/assets/runnablebtn.png\" style=\"width:67px;height:25px;\"></a>\n\n## Support\n\n - [Stack Overflow](http://stackoverflow.com/questions/tagged/mongoose)\n - [bug reports](https://github.com/learnboost/mongoose/issues/)\n - [help forum](http://groups.google.com/group/mongoose-orm)\n - [10gen support](http://www.mongodb.org/display/DOCS/Technical+Support)\n - (irc) #mongoosejs on freenode\n\n## Installation\n\nFirst install [node.js](http://nodejs.org/) and [mongodb](http://www.mongodb.org/downloads).\n\n $ npm install mongoose\n\n## Plugins\n\nCheck out the [plugins search site](http://plugins.mongoosejs.com/) to see hundreds of related modules from the community.\n\n## Contributors\n\nView all 90+ [contributors](https://github.com/learnboost/mongoose/graphs/contributors).\n\n## Get Involved\n\nStand up and be counted as a [contributor](https://github.com/LearnBoost/mongoose/blob/master/CONTRIBUTING.md) too!\n\n## Overview\n\n### Connecting to MongoDB\n\nFirst, we need to define a connection. If your app uses only one database, you should use `mongose.connect`. If you need to create additional connections, use `mongoose.createConnection`.\n\nBoth `connect` and `createConnection` take a `mongodb://` URI, or the parameters `host, database, port, options`.\n\n var mongoose = require('mongoose');\n\n mongoose.connect('mongodb://localhost/my_database');\n\nOnce connected, the `open` event is fired on the `Connection` instance. If you're using `mongoose.connect`, the `Connection` is `mongoose.connection`. Otherwise, `mongoose.createConnection` return value is a `Connection`.\n\n**Important!** Mongoose buffers all the commands until it's connected to the database. This means that you don't have to wait until it connects to MongoDB in order to define models, run queries, etc.\n\n### Defining a Model\n\nModels are defined through the `Schema` interface. \n\n var Schema = mongoose.Schema\n , ObjectId = Schema.ObjectId;\n\n var BlogPost = new Schema({\n author : ObjectId\n , title : String\n , body : String\n , date : Date\n });\n\nAside from defining the structure of your documents and the types of data you're storing, a Schema handles the definition of:\n\n* [Validators](http://mongoosejs.com/docs/validation.html) (async and sync)\n* [Defaults](http://mongoosejs.com/docs/api.html#schematype_SchemaType-default)\n* [Getters](http://mongoosejs.com/docs/api.html#schematype_SchemaType-get)\n* [Setters](http://mongoosejs.com/docs/api.html#schematype_SchemaType-set)\n* [Indexes](http://mongoosejs.com/docs/guide.html#indexes)\n* [Middleware](http://mongoosejs.com/docs/middleware.html)\n* [Methods](http://mongoosejs.com/docs/guide.html#methods) definition\n* [Statics](http://mongoosejs.com/docs/guide.html#statics) definition\n* [Plugins](http://mongoosejs.com/docs/plugins.html)\n* [pseudo-JOINs](http://mongoosejs.com/docs/populate.html)\n\nThe following example shows some of these features:\n\n var Comment = new Schema({\n name : { type: String, default: 'hahaha' }\n , age : { type: Number, min: 18, index: true }\n , bio : { type: String, match: /[a-z]/ }\n , date : { type: Date, default: Date.now }\n , buff : Buffer\n });\n\n // a setter\n Comment.path('name').set(function (v) {\n return capitalize(v);\n });\n\n // middleware\n Comment.pre('save', function (next) {\n notify(this.get('email'));\n next();\n });\n\nTake a look at the example in `examples/schema.js` for an end-to-end example of a typical setup.\n\n### Accessing a Model\n\nOnce we define a model through `mongoose.model('ModelName', mySchema)`, we can access it through
"readmeFilename": "README.md",
"_id": "mongoose@3.6.15",
"dist": {
"shasum": "4f0af0982c578614f1781c6758c7bc414830b627"
},
"_from": "mongoose@",
"_resolved": "https://registry.npmjs.org/mongoose/-/mongoose-3.6.15.tgz"
}