Skip to content

Commit

Permalink
Exclude Arbitre instance from checking a version.
Browse files Browse the repository at this point in the history
The 'MongoServer.Instances' property returns Arbiter in additional to
the Primary and Secondary nodes.
  • Loading branch information
ob1dev committed May 1, 2017
1 parent 7c4bfa4 commit 475129b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/TestMongoDBConnection/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ private static void TestConnectionString(string name, string connectionString)
{
MongoClient client = new MongoClient(connectionString);
var mongoServer = client.GetServer();

// Because of https://jira.mongodb.org/browse/CSHARP-881
mongoServer.Connect();
var buildInfos = mongoServer.Instances.Select(x => x.BuildInfo);

var buildInfos = mongoServer.Instances.Select(x => x.BuildInfo).Where(w => w != null);
var versionStrings = buildInfos.Select(x => x.VersionString);

Log.AppendLine();
Expand Down

0 comments on commit 475129b

Please sign in to comment.