Search code examples
javascriptmongodbmongooseatlas

How to change folder that I'm sending data to on mongoDB Atlas?


I'm creating MERN stack app. I've already created one and connected it to mongoDB Atlas cluster and everything works fine but everything has gone to "test" folder. So I'm creating another app, and want it to go to another folder, so my question is how can I define where I want my data to be stored? I created a folder, but I don't know how to direct data to go there.

1


Solution

  • That folder is a database in MongoDB. I'm sure you have /test in your connection URI string. You can specify there the database you want to create in another app. If there is no db specify, mongo will try to authenticate you to /admin database.

    MongoDB docs for reference.