@ -1041,7 +1041,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
return ( isOutOrMerge ? Flux . from ( cursor . toCollection ( ) ) : Flux . from ( cursor . first ( ) ) ) . thenMany ( Mono . empty ( ) ) ;
return ( isOutOrMerge ? Flux . from ( cursor . toCollection ( ) ) : Flux . from ( cursor . first ( ) ) ) . thenMany ( Mono . empty ( ) ) ;
}
}
return Flux . from ( cursor ) . concatMap ( readCallback : : doWith ) ;
return Flux . from ( cursor ) . flatMapSequential ( readCallback : : doWith ) ;
}
}
@Override
@Override
@ -1088,7 +1088,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
. withOptions ( optionsBuilder . build ( ) ) ;
. withOptions ( optionsBuilder . build ( ) ) ;
return aggregate ( $geoNear , collection , Document . class ) //
return aggregate ( $geoNear , collection , Document . class ) //
. concatMap ( callback : : doWith ) ;
. flatMapSequential ( callback : : doWith ) ;
}
}
@Override
@Override
@ -1314,7 +1314,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
Assert . notNull ( batchToSave , "Batch to insert must not be null" ) ;
Assert . notNull ( batchToSave , "Batch to insert must not be null" ) ;
return Flux . from ( batchToSave ) . flatMap ( collection - > insert ( collection , collectionName ) ) ;
return Flux . from ( batchToSave ) . flatMapSequential ( collection - > insert ( collection , collectionName ) ) ;
}
}
@Override
@Override
@ -1382,7 +1382,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
@Override
@Override
public < T > Flux < T > insertAll ( Mono < ? extends Collection < ? extends T > > objectsToSave ) {
public < T > Flux < T > insertAll ( Mono < ? extends Collection < ? extends T > > objectsToSave ) {
return Flux . from ( objectsToSave ) . flatMap ( this : : insertAll ) ;
return Flux . from ( objectsToSave ) . flatMapSequential ( this : : insertAll ) ;
}
}
protected < T > Flux < T > doInsertAll ( Collection < ? extends T > listToSave , MongoWriter < Object > writer ) {
protected < T > Flux < T > doInsertAll ( Collection < ? extends T > listToSave , MongoWriter < Object > writer ) {
@ -1433,7 +1433,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
return insertDocumentList ( collectionName , documents ) . thenMany ( Flux . fromIterable ( tuples ) ) ;
return insertDocumentList ( collectionName , documents ) . thenMany ( Flux . fromIterable ( tuples ) ) ;
} ) ;
} ) ;
return insertDocuments . flatMap ( tuple - > {
return insertDocuments . flatMapSequential ( tuple - > {
Document document = tuple . getT2 ( ) ;
Document document = tuple . getT2 ( ) ;
Object id = MappedDocument . of ( document ) . getId ( ) ;
Object id = MappedDocument . of ( document ) . getId ( ) ;
@ -1590,7 +1590,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
return collectionToUse . insertMany ( documents ) ;
return collectionToUse . insertMany ( documents ) ;
} ) . flatMap ( s - > {
} ) . flatMapSequential ( s - > {
return Flux . fromStream ( documents . stream ( ) //
return Flux . fromStream ( documents . stream ( ) //
. map ( MappedDocument : : of ) //
. map ( MappedDocument : : of ) //
@ -2147,7 +2147,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
publisher = collation . map ( Collation : : toMongoCollation ) . map ( publisher : : collation ) . orElse ( publisher ) ;
publisher = collation . map ( Collation : : toMongoCollation ) . map ( publisher : : collation ) . orElse ( publisher ) ;
return Flux . from ( publisher )
return Flux . from ( publisher )
. concatMap ( new ReadDocumentCallback < > ( mongoConverter , resultType , inputCollectionName ) : : doWith ) ;
. flatMapSequential ( new ReadDocumentCallback < > ( mongoConverter , resultType , inputCollectionName ) : : doWith ) ;
} ) ;
} ) ;
}
}
@ -2215,7 +2215,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
return Flux . from ( flux ) . collectList ( ) . filter ( it - > ! it . isEmpty ( ) )
return Flux . from ( flux ) . collectList ( ) . filter ( it - > ! it . isEmpty ( ) )
. flatMapMany ( list - > Flux . from ( remove ( operations . getByIdInQuery ( list ) , entityClass , collectionName ) )
. flatMapMany ( list - > Flux . from ( remove ( operations . getByIdInQuery ( list ) , entityClass , collectionName ) )
. flatMap ( deleteResult - > Flux . fromIterable ( list ) ) ) ;
. flatMapSequential ( deleteResult - > Flux . fromIterable ( list ) ) ) ;
}
}
/ * *
/ * *
@ -2674,7 +2674,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
return createFlux ( collectionName , collection - > {
return createFlux ( collectionName , collection - > {
return Flux . from ( preparer . initiateFind ( collection , collectionCallback : : doInCollection ) )
return Flux . from ( preparer . initiateFind ( collection , collectionCallback : : doInCollection ) )
. concatMap ( objectCallback : : doWith ) ;
. flatMapSequential ( objectCallback : : doWith ) ;
} ) ;
} ) ;
}
}