Open Nikitas-io opened 2 years ago
This is very interesting indeed and I think I have enough material for a new major release. I'll start working on it and see what I can come up with.
Thank you so much for your interest in the issue! I posted a question about this problem on Stack Overflow before opening this issue and given the fact that it got some upvotes it seems to me that other people would find this feature usefull as well ❤️🔥
Any updates on this issue yet??? 🕵️
please provide solution for this waiting or let us know how much time it will take , thanks in advance
Feature Request
So I'm using MongoDB Atlas, Mongoose, Multer, and GridFsStorage to upload files to a single database on the cloud which works fine, but I want to be able to upload files to different databases, using different database connections dynamically.
In order to do this, I want to set up my Multer GridFsStorage configuration so that the "db" field changes dynamically based on the API request. However, I can't access the HTTP request in the "db" field, which would make it impossible for me to change the DB connection dynamically and it seems to me that it is not currently possible do this.
The solution I'd like to see
I would like to see a way to make the GridFsStorage configuration work dynamically with multiple DB connections. Ideally, the "db" field in the GridFsStorage configuration would be able to function like the "file" field where the request is accessible through the parameters of a function: