Mongodb
Orka uses mongoose.
It will connect to mongodb automatically if a connection url is given.
eg:
MONGODB_URL={url} node app.js
Usage
//config/config.js
module.exports = {
mongodb: {
url: 'mongodb://localhost/orka' // to be used in development
}
};
//app/models/model.js
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const Model = new Schema(
{
key: { type: String, unique: true },
...
},
{
timestamps: {}
}
);
module.exports = mongoose.model('Model', Model);
You use mongoose as you would without worrying about connection initilization.