using: mongodb+srv://:@serverlessaws.onx2ah0.mongodb.net/?retryWrites=true&w=majority&appName=ServerlessAWS
No matter what I try (i.e. at the end of the string), it only connects to test database. Trying to connect to specific db (i.e. xyz)
using: mongodb+srv://:@serverlessaws.onx2ah0.mongodb.net/?retryWrites=true&w=majority&appName=ServerlessAWS
No matter what I try (i.e. at the end of the string), it only connects to test database. Trying to connect to specific db (i.e. xyz)
Add like here
/dbname?
Check options parameter for connect string in mongo documentation
Hi David, here is the documentation for where to add a specific DB in the connection string URI: https://www.mongodb.com/docs/v5.2/reference/connection-string/#components
Out of curiosity, is there a reason why you were trying the appName parameter?
Also, I want to ensure you’re aware that once you establish a client connection with the connection string, you can access specific DBs from the single connection. This is a best practice for good performance: https://www.mongodb.com/docs/manual/administration/connection-pool-overview/#use-an-instance-of-your-driver-s-mongoclient-object.
Topic | Replies | Views | Activity |
---|---|---|---|
I am geeting class: org.bson.codecs.configuration.CodecConfigurationException | 1 | 705 | May 2024 |
Encountered an issue while attempting to move an Azure MongoDB Atlas resource from one resource group (RG) to another. | 0 | 262 | Jun 2024 |
MongoDB Atlas - to - MongoDB AWS Community Edition Syncing | 19 | 382 | Feb 10 |
Mongodb Motor committing session even when i did not explicitly commit | 1 | 141 | Sep 2024 |
Open sourcing some parts of the graphql service | 0 | 26 | Feb 6 |