I am new to Reactive Programming trying UPSERT operation using Mono and concat with existed value in repository

Viewed 34

Here, In PUT method if it is empty invoking POST using REST API if not request payload going to save in repository

I need to save like append the existed field value with updated one. please if you any idea on this help me out

public Mono updateEmployee(int id,Employee emp){

return repo.existsById(id)

.switchIfEmpty(service.create(emp))

.flatMap(repo.save(emp); }

0 Answers
Related