@@ -205,6 +205,7 @@ public void TestAggregateOutputToCollection()
205205
206206 var query = _collection . Aggregate ( new AggregateArgs
207207 {
208+ BypassDocumentValidation = true ,
208209 Pipeline = new BsonDocument [ ]
209210 {
210211 new BsonDocument ( "$group" , new BsonDocument { { "_id" , "$x" } , { "count" , new BsonDocument ( "$sum" , 1 ) } } ) ,
@@ -873,6 +874,7 @@ public void TestFindAndModify()
873874 started = started . AddTicks ( - ( started . Ticks % 10000 ) ) ; // adjust for MongoDB DateTime precision
874875 var args = new FindAndModifyArgs
875876 {
877+ BypassDocumentValidation = true ,
876878 Query = Query . EQ ( "inprogress" , false ) ,
877879 SortBy = SortBy . Descending ( "priority" ) ,
878880 Update = Update . Set ( "inprogress" , true ) . Set ( "started" , started ) ,
@@ -2143,7 +2145,11 @@ public void TestInsertBatchContinueOnError()
21432145 document . Remove ( "_id" ) ;
21442146 }
21452147
2146- var options = new MongoInsertOptions { Flags = InsertFlags . ContinueOnError } ;
2148+ var options = new MongoInsertOptions
2149+ {
2150+ BypassDocumentValidation = true ,
2151+ Flags = InsertFlags . ContinueOnError
2152+ } ;
21472153 exception = Assert . Throws < MongoDuplicateKeyException > ( ( ) => collection . InsertBatch ( batch , options ) ) ;
21482154 result = exception . WriteConcernResult ;
21492155
@@ -2526,6 +2532,7 @@ public void TestMapReduce()
25262532
25272533 var result = _collection . MapReduce ( new MapReduceArgs
25282534 {
2535+ BypassDocumentValidation = true ,
25292536 MapFunction = map ,
25302537 ReduceFunction = reduce ,
25312538 OutputMode = MapReduceOutputMode . Replace ,
@@ -3043,7 +3050,9 @@ public void TestUpdate()
30433050 {
30443051 _collection . Drop ( ) ;
30453052 _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 ) ;
30473056
30483057 var expectedResult = new ExpectedWriteConcernResult
30493058 {
0 commit comments