Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:use host if hostReplicaSet is not provided #7559

Conversation

NthMetal
Copy link
Contributor

@NthMetal NthMetal commented Apr 9, 2021

Change was for MongoDriver's buildConnectionUrl method for building a connection url for a replica set.
Currently the host that is used is the config option called "hostReplicaSet"
The change updates this so that if this option is not provided it uses a provided "host" with the given port.
It also defaults to using "127.0.0.1" as a host if none is provided, and "27017" if no port was provided.

This change was needed because I did not provide a connection url to my typeorm config, but I provided all other neccessary info to build a connection url. However, I provided only a "host" and not "hostReplicaSet" which caused it to create a url with the host "undefined". I tested this on an environment with a replica set.

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • npm run lint passes with this change
  • npm run test passes with this change
  • This pull request links relevant issues as Fixes #0000
  • There are new or updated unit tests validating the change
  • Documentation has been updated to reflect this change
  • The new commits follow conventions explained in CONTRIBUTING.md

@NthMetal NthMetal changed the title use host if hostReplicaSet is not provided fix:use host if hostReplicaSet is not provided Apr 9, 2021
@AlexMesser AlexMesser merged commit 9b6d7bc into typeorm:master May 29, 2021
@AlexMesser
Copy link
Collaborator

thank you for contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants