title: MongoDB merge int arrays in one result
body: <p>I have this aggregation result</p>
  <pre class="lang-js prettyprint-override"><code>[
    {
      &quot;ids&quot;: [1,100]
    },
    {
      &quot;ids&quot;: [200, 100, 3]
    }
  ]
  </code></pre>
  <p>I want to merge them as one result like this:</p>
  <pre class="lang-js prettyprint-override"><code>[
      1,
      200,
      100,
      3
  ]
  </code></pre>
  <p>I have tried group but the result not like I want:</p>
  <pre class="lang-js prettyprint-override"><code>{
      $group: {
          _id: 1,
          merged: {
              $push: &quot;$ids&quot;
          }
      }
  }
  
  result:
  [
    {
      &quot;_id&quot;: 1,
      &quot;merged&quot;: [
        [1, 100],
        [200, 100, 3]
      ]
    }
  ]
  </code></pre>