mongoose-connection
MongooseConnection loads Mongoose models from a directory and connects to a MongoDB instance.
Installation
$ npm install mongoose-connection
Usage
var mongoose = var MongooseConnection = // Define database connection optionsvar opts = username: 'user' password: 'pass' host: 'localhost' port: 27107 database: 'db' modelsFilePath: __dirname + '/models' // Create the MongooseConnection objectvar mc = opts; // Connect to your databasemc // Access your modelsvar User = mongoose
License
MIT