You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 14, 2019. It is now read-only.
Now simpledb only works using one mongodb instance with one database.
Would be nice if this could be extended to support multiple instances/dbs. Currently working on some projects where this might be of use (they are not using simpledb yet, but I want to make the transition).
The text was updated successfully, but these errors were encountered:
Library have db object linked to last connected DataBase, so if you don't use it - I think all be ok.
Try something like that:
varsimpledb=require('mongoose-simpledb');vardb1Opts={connectionString: 'mongodb://localhost/db1',modelsDir: './db1Models'};vardb2Opts={connectionString: 'mongodb://localhost/db2',modelsDir: './db2Models'};simpledb.init(db1Opts,function(err,db1){if(err)returnconsole.error(err);// You can safely assume that db is populated with your models.db1.Comment.find({blogPost: 123}, ...):
});simpledb.init(db2Opts,function(err,db2){if(err)returnconsole.error(err);// You can safely assume that db is populated with your models.db2.Comment.find({blogPost: 123}, ...):
});
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Now simpledb only works using one mongodb instance with one database.
Would be nice if this could be extended to support multiple instances/dbs. Currently working on some projects where this might be of use (they are not using simpledb yet, but I want to make the transition).
The text was updated successfully, but these errors were encountered: