We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c2b6752 commit 2381ee4Copy full SHA for 2381ee4
.gitignore
@@ -5,3 +5,5 @@ debug
5
*.ipr
6
*.iws
7
.idea
8
+*.sublime-project
9
+*.sublime-workspace
mongo/client.go
@@ -190,6 +190,7 @@ func readPreferenceFromConnString(cs *connstring.ConnString) (*readpref.ReadPref
190
if cs.MaxStaleness != 0 {
191
options = append(options, readpref.WithMaxStaleness(cs.MaxStaleness))
192
}
193
+
194
if len(cs.ReadPreference) > 0 {
195
if rp == nil {
196
mode, _ := readpref.ModeFromString(cs.ReadPreference)
@@ -199,7 +200,8 @@ func readPreferenceFromConnString(cs *connstring.ConnString) (*readpref.ReadPref
199
200
201
202
- return rp, nil
203
204
+ return readPref.Primary();
205
206
207
// Database returns a handle for a given database.
0 commit comments