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 |
---|---|---|---|
Private endpoint not available for connection | 1 | 328 | Jun 2024 |
Mongodb realm sync react/realm | 1 | 296 | Jun 2024 |
Text index creation failure with unsupported language | 0 | 261 | Jul 2024 |
I can’t connect to self hosted MongoDB using my NodeJS server | 1 | 251 | Jul 2024 |
How to change highlight snippets size | 1 | 137 | Aug 2024 |