Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Mongo database connections #2590

Closed
seiyria opened this issue Sep 15, 2014 · 2 comments
Closed

Multiple Mongo database connections #2590

seiyria opened this issue Sep 15, 2014 · 2 comments

Comments

@seiyria
Copy link

seiyria commented Sep 15, 2014

(sorry if this is a duplicate issue, I could not find anything in search)

A StackOverflow post can be found here.

Will this be possible at any point in Meteor? It's cumbersome to have a second server running just for a second database.

@estark37
Copy link
Contributor

This is in fact possible using the _driver option to the Mongo.Collection constructor. Here's an (untested) example:

var d = new MongoInternals.RemoteCollectionDriver("<mongo url>");
C = new Mongo.Collection("<collection name>", { _driver: d });

This is an internal, undocumented, underscored interface, so use at your own risk. Also, in future, we prefer to answer this kind of question on Stack Overflow or meteor-talk, as we try to reserve GitHub for bug reports only. Thanks!

@seiyria
Copy link
Author

seiyria commented Sep 15, 2014

Sure, sorry. I wasn't sure what the protocol was. Thanks for updating that particular answer on SO (and thanks for answering me here too!), it's quite often referenced when looking at doing something like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants