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

How would you do to connect to multiple Mongoose URI #538

Open
llccrr opened this issue Jan 10, 2022 · 0 comments
Open

How would you do to connect to multiple Mongoose URI #538

llccrr opened this issue Jan 10, 2022 · 0 comments

Comments

@llccrr
Copy link

llccrr commented Jan 10, 2022

Hello,
I love the way you are declaring the mongo connection inside a loader, well injected.
However I was wondering how you would do if you wanted to instantiate two different connections ?
Usually, the right way of declaring two connection would be :

const conn1 = mongoose.createConnection(uri1);
const conn2 = mongoose.createConnection(uri2);

Then import these connections directly from the model files, do you know anyway of doing that while keeping the pattern you are using in this boilerplate ?

Thanks for the boilerplate,

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

1 participant