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

Fixed shard retrieval #25

Merged
merged 2 commits into from
Dec 4, 2020
Merged

Fixed shard retrieval #25

merged 2 commits into from
Dec 4, 2020

Conversation

antonsergeyev
Copy link
Contributor

@antonsergeyev antonsergeyev commented Dec 4, 2020

This fixes 2 problems I've encountered when working with sharded mongodb cluster:

  1. GetShards function always returned empty results, because a filter query was incorrect (it used nil as a filter instead of bson.D{})
  2. If there are multiple comma-separated hostnames for different mongodb replicas in each shard, the GetUrl function returned invalid URLs. Now it returns a first URL from the comma-separated list, which is imperfect, but at least it works.

@rwynn rwynn merged commit 9a7f147 into rwynn:master Dec 4, 2020
@rwynn
Copy link
Owner

rwynn commented Dec 6, 2020

@antonsergeyev thanks for your 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.

2 participants