Search code examples
mongodbconnection-stringmongodb-atlas

Save data to new database on MongoDB Atlas within a cluster


I created a new database inside my MongoDB Atlas Cluster called "production", so far my server has been writing all the data to the "test" database in the cluster.

How do I get the connection-string for the new production database so I can write to it and instead of "test" database in my cluster?

Thank you!

// Currently writing to "test" but want to write to "production" enter image description here


Solution

  • In your connection string you have the database name, replace test to production and it will work.

    Let me know if there is an issue.