Skip to content

Commit d93112a

Browse files
author
rstam
committed
CSHARP-913: Add "text" to the whitelist of commands that can be sent to a secondary.
1 parent 4c37e05 commit d93112a

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

MongoDB.Driver/CanCommandBeSentToSecondary.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,16 @@ public static class CanCommandBeSentToSecondary
3030
private static Func<BsonDocument, bool> __delegate = DefaultImplementation;
3131
private static HashSet<string> __secondaryOkCommands = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase)
3232
{
33-
"group",
3433
"aggregate",
3534
"collStats",
3635
"dbStats",
3736
"count",
3837
"distinct",
3938
"geoNear",
4039
"geoSearch",
41-
"geoWalk"
40+
"geoWalk",
41+
"group",
42+
"text"
4243
};
4344

4445
// public static properties

MongoDB.DriverUnitTests/CanCommandBeSentToSecondaryTests.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,17 @@ public void TestSetDelegate()
3939
CanCommandBeSentToSecondary.Delegate = CanCommandBeSentToSecondary.DefaultImplementation; // reset Delegate
4040
}
4141

42-
[TestCase("group", true)]
4342
[TestCase("aggregate", true)]
43+
[TestCase("collStats", true)]
44+
[TestCase("dbStats", true)]
45+
[TestCase("count", true)]
46+
[TestCase("distinct", true)]
47+
[TestCase("geoNear", true)]
4448
[TestCase("geoSearch", true)]
45-
[TestCase("blah", false)]
49+
[TestCase("geoWalk", true)]
50+
[TestCase("group", true)]
51+
[TestCase("text", true)]
4652
[TestCase("foo", false)]
47-
[TestCase("bar", false)]
4853
[TestCase("mapreduce", false)]
4954
public void TestCanSendCommandToSecondary(string command, bool expectedResult)
5055
{

0 commit comments

Comments
 (0)