[GODRIVER-1067] ping can not reject invalid passwords Created: 16/May/19  Updated: 11/Sep/19  Resolved: 16/May/19

Status: Closed
Project: Go Driver
Component/s: Connections
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: HouDezhi Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

I connect to my mongodb server like this:
client, _ := mongo.NewClient(options.Client().ApplyURI("mongodb://my_username:my_passwd@my_host:27017/my_db"))
ctx, cancelFunc := context.WithTimeout(context.Background(), 10*time.Second)
defer cancelFunc()
_ = client.Connect(ctx)
err = client.Ping(ctx, nil)
But no matter what password I enter correctly or incorrectly, Ping will not get an error.
So how can I find this error before I operate my mongo?



 Comments   
Comment by Ian Whalen (Inactive) [ 16/May/19 ]

star_hdz Thanks for the question - as we've investigated, the Ping() method currently only does server selection, but we've filed a bug report to add in calling the ping server command as well. Please follow along in GODRIVER-1068 to see when we have fixed this.

Generated at Thu Feb 08 08:35:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.