title: How to save object to reactive repository inside flux
body: <p>I have list of answers on questions. I want to save those answers and then (after mongo gives them an id) add them to their questions. </p>
  
  <p>Now I'm doing it this way:</p>
  
  <pre class="lang-java prettyprint-override"><code>public Flux&lt;Answer&gt; createAnswers(List&lt;Answer&gt; answers) {
      return answerRepository.saveAll(answers)
              .map(answer -&gt; {
                  questionRepository.findById(answer.getQuestionId())
                          .subscribe(question -&gt; {
                              question.getAnswers().removeIf(ans -&gt; Objects.equals(ans.getId(), answer.getId()));
                              question.getAnswers().add(answer);
                              questionRepository.save(question).block();
                          });
                  return answer;
              });
  }
  </code></pre>
  
  <p>I also tried with <code>..saveAll(answers).doOnNext()</code> and <code>doOnEach()</code> but this way questions are not saved. </p>
  
  <p>It seems that map is used to transform data but not for doing operations on each element. Also I'm a bit confused with call to <code>block()</code>. </p>
  
  <p>Is there a better way to achieve my aim? </p>