[CSHARP-1349] Re-enable Ping through MongoClient Created: 16/Jul/15  Updated: 17/Jul/15  Resolved: 17/Jul/15

Status: Closed
Project: C# Driver
Component/s: Connectivity
Affects Version/s: 2.0.1
Fix Version/s: None

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


 Description   

Please re-enable the Ping function that currently only operates in the synchronous legacy branch with MongoServer to work with MongoClient async code.



 Comments   
Comment by Chad Kreimendahl [ 17/Jul/15 ]

In that event... It's throwing an exception when I run that command. I'll send it over tomorrow when I'm at the PC

Comment by Craig Wilson [ 17/Jul/15 ]

Hi Chad,

Ping is just a command(http://docs.mongodb.org/manual/reference/command/ping/) that you can run using database.RunCommandAsync.

var command = new BsonDocument("ping", 1);
var result = await database.RunCommandAsync<BsonDocument>(command);

Craig

Generated at Wed Feb 07 21:39:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.