title: How to copy/clone a mongodb collection to another one?
body: <p>I'm trying to copy a collection(huge or small) to another collection in the same mongo database using spring-data.</p>
  
  <p>Every solution I found, was deprecated or wasn't working.
  I tried this one who seem the best for my need:</p>
  
  <pre><code>    mongoTemplate.getCollection("oneCollection").aggregate(Arrays.asList(new Document("$out","otherCollection")));
  </code></pre>
  
  <p>But it doesn't do anything, no error, no action on the database.</p>
  
  <p>Do you have any solution for copying a collection easily using spring-data ?</p>