This commit is contained in:
Christoph Strobl
2023-01-25 15:05:56 +01:00
parent b9f6463337
commit d94d273010

View File

@@ -1569,14 +1569,9 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
deferredFilter = Mono
.from(
collection.find(filter, Document.class).projection(updateContext.getMappedShardKey(entity)).first())
.zipWith(replacement)
//.defaultIfEmpty(replacement)
.switchIfEmpty(replacement)
.map(it -> {
if(it.getT1() == null) {
return updateContext.applyShardKey(entity, filter, it.getT2());
} else {
return updateContext.applyShardKey(entity, filter, it.getT1());
}
return updateContext.applyShardKey(entity, filter, it);
});
}
} else {