Skip to content

Using protocol mongdb+srv fails because it is not valid to set port in connection url #496

Description

@jareeve

Description/Steps to reproduce

If protocol in the datasource is set to mongdb+srv then the url constructed by the connector also adds in the default port but it not valid to specify the port in the url and a client error is thrown.

If I modify the connector code to not add in the port to the url when protocol is mongodb+srv then it all works fine.

I am testig using a database on mongodb.com.

Link to reproduction sandbox

Expected result

Additional information

I have the code changes that fix this issue. I will provide the changes in a PR and link it from here. Feel free to reject the pr if you have a better way to fix it.

Many thanks, John.

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions