0

I am comparing the Connection String in our codebase, against the one used in Studio 3T.

The Connection String in our codebase:

mongodb://username:password@host/targetDbName?ssl=true

The Connection String in Studio 3T:

mongodb://username:password@host/?ssl=true&authSource=targetDbName

Is the Connection String in our codebase correct? Or does it have to be rewritten to include ?authSource=...?

Because at the start of the Connection String URI Format documentation, it's specified the Connection String has the form

mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]

Does defaultauthdb correspond to authSource? Or are these 2 different things?

I thought this is conflicting information, or is it true that both Connection String formats (codebase & Studio3T) can work to establish the connection?

I am not able to try another Connection String for our codebase as it is already on our dev server. I am not able to recreate the settings & environment locally.

waffledood
  • 193
  • 8
  • 2
    See https://stackoverflow.com/questions/63754742/authentication-failure-while-trying-to-save-to-mongodb/63755470#63755470 – Wernfried Domscheit Apr 20 '23 at 07:54
  • 1
    @WernfriedDomscheit thank you! that means the Connection String in our codebase is correct. I tested said Connection String by importing it into Studio 3T & I was able to connect to the MongoDB database – waffledood Apr 20 '23 at 08:02

0 Answers0