@@ -205,6 +205,7 @@ public void TestAggregateOutputToCollection()
205
205
206
206
var query = _collection . Aggregate ( new AggregateArgs
207
207
{
208
+ BypassDocumentValidation = true ,
208
209
Pipeline = new BsonDocument [ ]
209
210
{
210
211
new BsonDocument ( "$group" , new BsonDocument { { "_id" , "$x" } , { "count" , new BsonDocument ( "$sum" , 1 ) } } ) ,
@@ -873,6 +874,7 @@ public void TestFindAndModify()
873
874
started = started . AddTicks ( - ( started . Ticks % 10000 ) ) ; // adjust for MongoDB DateTime precision
874
875
var args = new FindAndModifyArgs
875
876
{
877
+ BypassDocumentValidation = true ,
876
878
Query = Query . EQ ( "inprogress" , false ) ,
877
879
SortBy = SortBy . Descending ( "priority" ) ,
878
880
Update = Update . Set ( "inprogress" , true ) . Set ( "started" , started ) ,
@@ -2143,7 +2145,11 @@ public void TestInsertBatchContinueOnError()
2143
2145
document . Remove ( "_id" ) ;
2144
2146
}
2145
2147
2146
- var options = new MongoInsertOptions { Flags = InsertFlags . ContinueOnError } ;
2148
+ var options = new MongoInsertOptions
2149
+ {
2150
+ BypassDocumentValidation = true ,
2151
+ Flags = InsertFlags . ContinueOnError
2152
+ } ;
2147
2153
exception = Assert . Throws < MongoDuplicateKeyException > ( ( ) => collection . InsertBatch ( batch , options ) ) ;
2148
2154
result = exception . WriteConcernResult ;
2149
2155
@@ -2526,6 +2532,7 @@ public void TestMapReduce()
2526
2532
2527
2533
var result = _collection . MapReduce ( new MapReduceArgs
2528
2534
{
2535
+ BypassDocumentValidation = true ,
2529
2536
MapFunction = map ,
2530
2537
ReduceFunction = reduce ,
2531
2538
OutputMode = MapReduceOutputMode . Replace ,
@@ -3043,7 +3050,9 @@ public void TestUpdate()
3043
3050
{
3044
3051
_collection . Drop ( ) ;
3045
3052
_collection . Insert ( new BsonDocument ( "x" , 1 ) ) ;
3046
- var result = _collection . Update ( Query . EQ ( "x" , 1 ) , Update . Set ( "x" , 2 ) ) ;
3053
+ var options = new MongoUpdateOptions { BypassDocumentValidation = true } ;
3054
+
3055
+ var result = _collection . Update ( Query . EQ ( "x" , 1 ) , Update . Set ( "x" , 2 ) , options ) ;
3047
3056
3048
3057
var expectedResult = new ExpectedWriteConcernResult
3049
3058
{
0 commit comments