How to update a Webflux object from repository and save it back
I want to 1) get an object from my repository, 2) update that object and then 3) save it back.
I've already done first two things:
fun updateUniversity(id: ObjectId,
newName: String,
newCity: String,
newYearOfFoundation: Int): Mono {
return universityRepository
.findById(id)
.switchIfEmpty(Mono.error(NoSuchElementException()))
.map {
if (newCity.isNotEmpty()) it.city = newCity
if...