@@ -19,7 +19,11 @@ package com.mongodb
19
19
import org.bson.types.ObjectId
20
20
import spock.lang.Unroll
21
21
22
- import static com.mongodb.Fixture.*
22
+ import static com.mongodb.Fixture.isReplicaSet
23
+ import static com.mongodb.Fixture.isServerStartedWithJournalingDisabled
24
+ import static com.mongodb.Fixture.isSharded
25
+ import static com.mongodb.Fixture.isStandalone
26
+ import static com.mongodb.Fixture.serverIsAtLeastVersion
23
27
import static com.mongodb.WriteRequest.Type.INSERT
24
28
import static com.mongodb.WriteRequest.Type.REMOVE
25
29
import static com.mongodb.WriteRequest.Type.REPLACE
@@ -363,6 +367,23 @@ class BulkWriteOperationSpecification extends FunctionalSpecification {
363
367
collection. count() == 1
364
368
}
365
369
370
+ def ' when two update documents together exceed 16MB, the documents are still updated' () {
371
+ given :
372
+ def operation = collection. initializeOrderedBulkOperation()
373
+ operation. find(new BasicDBObject (' _id' , 1 ))
374
+ .update(new BasicDBObject (' $set' , new BasicDBObject (' x' , new byte [1024 * 1024 * 8 ])));
375
+ operation. find(new BasicDBObject (' _id' , 2 ))
376
+ .update(new BasicDBObject (' $set' , new BasicDBObject (' x' , new byte [1024 * 1024 * 8 ])));
377
+
378
+ when :
379
+ def result = operation. execute()
380
+
381
+ then :
382
+ result == new AcknowledgedBulkWriteResult (UPDATE , 0 , expectedModifiedCount(0 ), [])
383
+ collection. count() == 0
384
+ }
385
+
386
+
366
387
def ' should handle multi-length runs of ordered insert, update, replace, and remove' () {
367
388
given :
368
389
collection. insert(getTestInserts())
0 commit comments