Lazy driver initalization
Opened this issue · 1 comments
AndrewGrachov commented
This is quite standard way of doing things, like they do in teh mongoose. Allows you to instantly provide storage to models & collections, keeping them static, e.g
var MongoDb = require('backbone-db-mongo-db');
var store = new MongoDb('yourconnectionstringhere');
module.exports = store;
//later, yourModel.js
var store = require('./mongodb');
module.exports = serverbone.models.BaseModel.extend({
store: store
})
AndrewGrachov commented