I'm trying to wrap my head around reactive programming, specifically with Spring and Spring Data R2DBC. One thing that would help me understand it better is to do a find/modify/save or "upsert" of an object. A traditional interaction might look like this:
Book save(Book book) {
Book existing = repository.findByIsbn(book.getIsbn())
if (existing != null) {
return repository.save(found.copyMutableValuesFrom(book));
}
return repository.save(book);
}
How might this look with Monos? I understand how to do a straight find, or a straight save, but a more complicated find/update/save or upsert is eluding me.
Thanks.