title: Combine two fields from different documents in Mongodb
body: <p>I have these documents in a collection :</p>
  
  <pre><code>   {topic : "a",
      messages : [ObjectId("21312321321323"),ObjectId("34535345353"),...]
     },
     {topic : "b,
      messages : [ObjectId("1233232323232"),ObjectId("6556565656565"),...]
     }
  </code></pre>
  
  <p>Is there a posibility to get a result with the combination of messages fields ? I like to get this for example :</p>
  
  <pre><code>     {[
         ObjectId(""),ObjectId(""),ObjectId(""),ObjectId("")
       ]}
  </code></pre>
  
  <p>I thought that this was possible with MapReduce but in my case the documents doesn't have anything in common. Right now I'm doing this in the backend using javascript and loops, but i think that this isn't the best option. Thanks.</p>