I'm new in Spring WebFlux I'm using the reactive repository to User entity from the Database :
Mono<User> user = userRepository.findById(userId);
I want to convert the Mono<User> to Mono<UserDTO>
this is my method that converts my DTO :
public UserDTO getUserResourceFromUser(User user){
var userDTO= new UserDTO();
userDTO.setId(user.getId());
userDTO.setUserName(user.getUserName());
return userDTO;
}
could you please help me to adjust my getUserResourceFromUser Method to return Mono<UserDTO> without losing non-blocking behavior?
Thanks in advance.