title: How do I append Mongo DB aggregation results to an existing collection?
body: <p>I am trying to perform several insertions on an existent Mongo DB collection using the following code</p>
  
  <pre><code>db.dados_meteo.aggregate( [
                    { $match : { "POM" : "AguiardaBeira" } },
                    { $project : {
                       _id : { $concat: [
                          "0001:",
                        { $substr: [ "$DTM", 0, 4 ] },
                        { $substr: [ "$DTM", 5, 2 ] },
                        { $substr: [ "$DTM", 8, 2 ] },
                        { $substr: [ "$DTM", 11, 2 ] },
                        { $substr: [ "$DTM", 14, 2 ] },
                        { $substr: [ "$DTM", 17, 2 ] }
                         ] },
                      "RNF" : 1, "WET":1,"HMD":1,"TMP":1 } },
                    { $out : "dados_meteo_reloaded" }
                ] )
  </code></pre>
  
  <p>But each time I change the $match parameters and make a new aggregation, Mongo DB deletes the previous documents and inserts the new result.</p>
  
  <p>Could you help me?</p>