Комментарии:
thanks bro
ОтветитьI tried this method of your to create connection successfully. However, I got an issue that is when the first time the app initiate connections, if somehow the internet get disconnected or link to database is down(database is not local), therefore the app fail to initiate the instance so that the whole app crash because it can not use the .model() of failed connection. If anyone has any idea or work around about this problem, please let me know.
ОтветитьCould you please post the code itself in the description(or upload it in a link)? It should take just a moment and would help me a lot.
ОтветитьHow do you reference the db1 and db2 if the Models and routes are defined in different files? Lmk If i can clarify my question better.
ОтветитьNice
ОтветитьCan you still reference other objects that are in different DB's?
ex:
Name: {name: String}
Email: {email: String, user_id: { type: Schema.Types.ObjectId, ref: 'Name'}}
Thank you!
Ответить