https://kotlinlang.org logo
Title
u

user

07/19/2022, 4:41 PM
MongoDB exception DuplicateKey while saving I have a simple method to update my object fun updateUniversity(university: University): Mono { if (university.id == null) { return Mono.empty() } return universityRepository .findById(university.id!!) .filter { it.name == university.name } .map { university.copy() } .flatMap { universityRepository.save(it) } } and it fails on saving the result (org.springframework.dao.DuplicateKeyException). But saving is not only about creating...