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 |
---|---|---|---|
Simple relationship in mongodb async | 1 | 179 | Aug 2024 |
How to improve the search accuracy of MongoDBAtlasVectorSearch | 0 | 21 | Sep 2024 |
Error connecting to mongodb atlas from netlify server through functions | 3 | 100 | Oct 2024 |
IP Address of the connections | 0 | 45 | Jan 2 |
Export schema across collections | 1 | 65 | Jan 22 |