Skip to content

Commit 4094924

Browse files
author
Alice Thum
committed
Pass read preference in mongo.Client Ping method.
Change-Id: I865fe63a872905287451f2587c10af470b8f0e32
1 parent 431fe7c commit 4094924

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mongo/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func (c *Client) Ping(ctx context.Context, rp *readpref.ReadPref) error {
144144
db := c.Database("admin")
145145
res := db.RunCommand(ctx, bson.D{
146146
{"ping", 1},
147-
})
147+
}, options.RunCmd().SetReadPreference(rp))
148148

149149
return replaceErrors(res.Err())
150150
}

0 commit comments

Comments
 (0)