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

Option to specify the mongo driver #43

Closed
MatejJan opened this issue Apr 14, 2016 · 2 comments
Closed

Option to specify the mongo driver #43

MatejJan opened this issue Apr 14, 2016 · 2 comments

Comments

@MatejJan
Copy link
Member

Sometimes you need to connect to multiple mongo databases from the same app. That can be done by specifying the internal mongo driver when creating the collection as show here:

var database = new MongoInternals.RemoteCollectionDriver("<mongo url>");
MyCollection = new Mongo.Collection("collection_name", { _driver: database });

This could work in PeerDB in a similar fashion that you can specify a custom collection to use.

@mitar
Copy link
Member

mitar commented Apr 14, 2016

Hm, so why not specifying then this MyCollection to PeerDB?

See here example for custom DDP connection. You can do a similar thing for multiple databases, no?

But really, multiple MongoDB databases, what type of an app you are doing? ;-)

@MatejJan
Copy link
Member Author

MatejJan commented May 6, 2016

Ah, yes, I forget that you can pass exactly which collection to use directly as well.

I was going to have store purchases in a separate database than the main app db. I'm now reconsidering how useful this is. :)

@MatejJan MatejJan closed this as completed May 6, 2016
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