@@ -107,7 +107,8 @@ class ChangeStreamOperationSpecification extends OperationFunctionalSpecificatio
107
107
def expected = insertDocuments(helper, [1 , 2 ])
108
108
109
109
then :
110
- nextAndClean(cursor, async) == expected
110
+ def next = nextAndClean(cursor, async)
111
+ next == expected
111
112
112
113
when :
113
114
expected = insertDocuments(helper, [3 , 4 , 5 , 6 , 7 ])
@@ -286,29 +287,25 @@ class ChangeStreamOperationSpecification extends OperationFunctionalSpecificatio
286
287
helper. insertDocuments(docs. collect { BsonDocument . parse(" {_id: $it , a: $it }" ) }, WriteConcern . MAJORITY )
287
288
docs. collect {
288
289
BsonDocument . parse(""" {
289
- "_id": {
290
- "documentKey": {"_id": $it }
291
- },
292
290
"operationType": "insert",
293
291
"fullDocument": {"_id": $it , "a": $it },
294
- "ns": {"coll ": "${ helper.getNamespace().getCollectionName ()} ", "db ": "${ helper.getNamespace().getDatabaseName ()} "},
292
+ "ns": {"db ": "${ helper.getNamespace().getDatabaseName ()} ", "coll ": "${ helper.getNamespace().getCollectionName ()} "},
295
293
"documentKey": {"_id": $it }
296
294
}""" )
297
295
}
298
296
}
299
297
300
298
def tryNextAndClean (cursor , boolean async ) {
301
- removeTimestampAndUUID (tryNext(cursor, async))
299
+ removeId (tryNext(cursor, async))
302
300
}
303
301
304
302
def nextAndClean (cursor , boolean async ) {
305
- removeTimestampAndUUID (next(cursor, async))
303
+ removeId (next(cursor, async))
306
304
}
307
305
308
- def removeTimestampAndUUID (List<BsonDocument > next ) {
306
+ def removeId (List<BsonDocument > next ) {
309
307
next?. collect { doc ->
310
- doc. getDocument(' _id' ). remove(' clusterTime' )
311
- doc. getDocument(' _id' ). remove(' uuid' )
308
+ doc. remove(' _id' )
312
309
doc
313
310
}
314
311
}
0 commit comments