title: Webflux mongo save multiple models
body: <p>In my application I have servers and users, each user can have multiple servers. The servers list in <code>User</code> is a <code>@DBref</code>:</p>
  
  <pre><code>@DBRef
  private List&lt;Server&gt; servers;
  </code></pre>
  
  <p>In the controller where I want to create a server I first create and save the server, after that I add the server to the server list in user and save the user:</p>
  
  <pre><code>@PostMapping
  public Mono create(@Valid @RequestBody Server server, Mono&lt;Authentication&gt; authentication) {
      return this.serverRepository.save(server) // This works, the server is saved.
              .and(authentication.map(value -&gt; {
                  User user = (User) value.getDetails();
                  System.out.println(user); // This works, so this function is called.
                  if (user.getServers() == null) {
                      // Create empty list so .add can be used.
                      user.setServers(new ArrayList&lt;&gt;());
                  }
                  user.getServers().add(server);
                  return userRepository.save(user); // Isn't working, in the UserCascadeSaveMongoEventListener I don't see it.
              }));
  }
  </code></pre>
  
  <p>I think the way I use <code>.and()</code> isn't right.</p>
  
  <p>To save the relation I have the <code>UserCascadeSaveMongoEventListener</code>:</p>
  
  <pre><code>public class UserCascadeSaveMongoEventListener extends AbstractMongoEventListener&lt;Object&gt; {
  
      @Autowired
      private MongoOperations mongoOperations;
  
      @Override
      public void onBeforeConvert(BeforeConvertEvent&lt;Object&gt; event) {
          Object source = event.getSource();
          System.out.println(source); // On server create only the Server is shown, User is not shown.
          if ((source instanceof User) &amp;&amp; (((User) source).getServers() != null)) {
              mongoOperations.save(((User) source).getServers());
          }
      }
  }
  </code></pre>
  
  <p>But this class doesn't matter at the moment because the user isn't save at all.</p>
  
  <p>The repositories used are all normal ReactiveCrudRepositories.</p>
  
  <p>What is the right way to reactively call multiple repositories with multiple Mono's?</p>