I am currently working on an inventory management system using the MERN stack (MongoDB, Express.js, React.js, Node.js). I have a requirement to create a separate MongoDB database for each admin user and map the corresponding connection string to that particular user. This will ensure that each admin has isolated data storage.
Could anyone guide me on how to achieve the following:
Dynamically create a new MongoDB database for each admin user upon registration.
Store and manage the connection string for each user securely.
Ensure that the correct database is accessed based on the logged-in admin user.
Any advice, code snippets, or best practices would be greatly appreciated.
Thank you!
im new to this let me know