Search code examples
javamongodbspring-bootmonoreactive

How to initialize an empty Mono Class object in reactive programming?


I am learning reactive and I wanted to know how to initialize a Mono object, like in Java when:User usr=new User().

How to create a Mono object of this similar class?


Solution

  • There are different ways you can create an object. Checkout this link for better understanding https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Mono.html Here you can just use the Mono.just(new User());