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