Skip to content

Commit 98b07a4

Browse files
Retain order doing reactive save operations with multiple elements.
1 parent c14bd9d commit 98b07a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/SimpleReactiveMongoRepository.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public <S extends T> Flux<S> saveAll(Iterable<S> entities) {
114114

115115
return source.stream().allMatch(entityInformation::isNew) ? //
116116
mongoOperations.insert(source.stream().collect(Collectors.toList()), entityInformation.getCollectionName()) : //
117-
Flux.fromIterable(entities).flatMap(this::save);
117+
Flux.fromIterable(entities).flatMapSequential(this::save);
118118
}
119119

120120
@Override

0 commit comments

Comments
 (0)