File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
MongoDB.Driver/CommandResults
MongoDB.DriverUnitTests/CommandResults Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,17 @@ public int MinWireVersion
161
161
get { return Response . GetValue ( "minWireVersion" , 0 ) . ToInt32 ( ) ; }
162
162
}
163
163
164
+ /// <summary>
165
+ /// Gets the maximum size of the write batch.
166
+ /// </summary>
167
+ /// <value>
168
+ /// The maximum size of the write batch.
169
+ /// </value>
170
+ public int MaxWriteBatchSize
171
+ {
172
+ get { return Response . GetValue ( "maxWriteBatchSize" , 1000 ) . ToInt32 ( ) ; }
173
+ }
174
+
164
175
/// <summary>
165
176
/// Gets the message.
166
177
/// </summary>
Original file line number Diff line number Diff line change @@ -62,5 +62,30 @@ public void TestMaxMessageLengthWhenNotServerSuppliedUsesMaxBsonObjectSizeWhenLa
62
62
63
63
Assert . AreEqual ( MongoDefaults . MaxMessageLength + 1024 , result . MaxMessageLength ) ;
64
64
}
65
+
66
+ [ Test ]
67
+ public void TestMaxWriteBatchSizeWhenServerSupplied ( )
68
+ {
69
+ var document = new BsonDocument
70
+ {
71
+ { "ok" , 1 } ,
72
+ { "maxWriteBatchSize" , 200 }
73
+ } ;
74
+ var result = new IsMasterResult ( document ) ;
75
+
76
+ Assert . AreEqual ( 200 , result . MaxWriteBatchSize ) ;
77
+ }
78
+
79
+ [ Test ]
80
+ public void TestMaxWriteBatchSizeWhenNotServerSupplied ( )
81
+ {
82
+ var document = new BsonDocument
83
+ {
84
+ { "ok" , 1 }
85
+ } ;
86
+ var result = new IsMasterResult ( document ) ;
87
+
88
+ Assert . AreEqual ( 1000 , result . MaxWriteBatchSize ) ;
89
+ }
65
90
}
66
91
}
You can’t perform that action at this time.
0 commit comments