I also checked your repo and docs, I see you support more than one defineMongooseConnection:
https://nuxt-mongoose.nuxt.space/docs/api/utils#definemongooseconnection
But I suspect it doesn't support different models for different connections. I guess, all the used records will be just duplicated between the connections.
I expect separation by different connections and models dirs.
Let me know please, if you don't plan to support the described feature, I'd try to implement it for my own project. But it'd be nice if you advise me on what to pay my attention.
this is great idea to have! but it definitely needs work to be done... I've been quite busy lately but I hope I can find some time in the next month to some issue tirage.
I want to separate logic between Nuxt 3 Layers and different DB connections:
I want to have a few DB connections. Is it possible? If not, can I expect this feature will be delivered soon?
I see it's possible for SQL databases for Nitro OOTB. I want to have the same for MongoDB: https://nitro.build/guide/database#configuration
I also checked your repo and docs, I see you support more than one
defineMongooseConnection
: https://nuxt-mongoose.nuxt.space/docs/api/utils#definemongooseconnection But I suspect it doesn't support different models for different connections. I guess, all the used records will be just duplicated between the connections.I expect separation by different connections and models dirs.
Usage:
page.scheme.ts
inmodels/cms
directory has to be automatically prefixed likeCmsPage
:user.scheme.ts
inmodels/ecommerce
directory has to be automatically prefixed likeEcommerceUser
:Just keep in mind that the folders have to be in different layers, just merged in result application, like
More about layers here:
Let me know please, if you don't plan to support the described feature, I'd try to implement it for my own project. But it'd be nice if you advise me on what to pay my attention.
It also could solve the previous Issues: