Mongoose initializer for APX API server
Simply add the initializer to the Apx config.
$ npm install apx apx-mongoose
var apx = require('apx')
apx.start({
initializers: [require('apx-mongoose')],
mongoose: {name: 'my-database', models: ['models/*.js']}
})
mongoose.host
127.0.0.1
Hostname ot connect to MongoDB
mongoose.name
Name of database to use
mongoose.user
''
Username to connect to MongoDB
mongoose.password
''
Password to connect to MongoDB
Can be an array of globs or an array of paths or a single path or even an array of objects.
Models are loaded directly from the APX models config value models
.
The model format follows the basic construction of models from mongoose and other NOSQL databases.
exports.name = 'modelName'
exports.description = 'Model Description'
exports.schema = MongooseSchema
exports.model = MongooseModel
Upgraded to APX 0.7.0 (no other changes)
Language | javascript |
Version | 0.5.1 |
Git URL | https://github.com/nullivex/apx-mongoose |
License | MIT |
Description | APX module for Mongoose |
Keywords |