title: Updating Mono object by another Mono object
body: <p>Dears,
  I'm a stuck with implementing a function (it is basically an update operation) that's capable of taking a Mono as a param and return an updated version of Mono where:</p>
  <ul>
  <li>the returned instance derives from a db query;</li>
  <li>the updated version of Mono contains fields picked by Mono.</li>
  </ul>
  <p>This is the sample code (that works from providing directly the object, without using the Mono instance:</p>
  <pre><code>public Mono&lt;CompanyDto&gt; updateById(String id, CompanyDto companyDtoMono) {
      return getCompanyById(id).map(companyEntity -&gt; {
          companyEntity.setDescription(companyDtoMono.getDescription());
          companyEntity.setName(companyDtoMono.getName());
          return companyEntity;
      }).flatMap(companyEntity2 -&gt; reactiveNeo4JTemplate.save(companyEntity2)).map(companyEntity -&gt; companyMapper.toDto(companyEntity));
  
  }`
  </code></pre>
  <p>Question is: how can I change the code if the function signature would be</p>
  <pre><code>public Mono&lt;CompanyDto&gt; updateById(String id, Mono&lt;CompanyDto&gt; companyDtoMono)
  </code></pre>
  <p>PS:</p>
  <pre><code>getCompanyById(id)
  </code></pre>
  <p>returns a</p>
  <pre><code>Mono&lt;CompanyEntity&gt;
  </code></pre>
  <p>Thanks,
  best</p>
  <p>FB</p>