title: how to group objects and display all expected fields in the query with MongoDB
body: <p>I have the collection below, I need to make a query that group by confrontationId and display the results as expected, is there a way to do this with MongoDB, I need to group only the matches..</p>
  <pre><code> {
      &quot;rounds&quot;: {
          &quot;matches&quot;: [{
                  &quot;id&quot;: &quot;8cac353e-fb04-4a9a-b340-ed64e1094ff1&quot;,
                  &quot;confrontationId&quot;: &quot;2f2c58c9-f1be-4914-8aee-03d00725a0be&quot;,
                  &quot;arena&quot;: &quot;Tacoma Dome&quot;,
                  &quot;status&quot;: &quot;FINISHED&quot;
              },
              {
                  &quot;id&quot;: &quot;d8ff6322-824c-455c-b59d-d837d0188d93&quot;,
                  &quot;confrontationId&quot;: &quot;41d85805-5571-42c6-a38e-e03fd8fcdc96&quot;,
                  &quot;arena&quot;: &quot;Baku Crystal Hall&quot;,
                  &quot;status&quot;: &quot;FINISHED&quot;
              },
              {
                  &quot;id&quot;: &quot;e23dc4ce-24de-4f7f-b5b0-9b124ec0e71a&quot;,
                  &quot;confrontationId&quot;: &quot;2f2c58c9-f1be-4914-8aee-03d00725a0be&quot;,
                  &quot;arena&quot;: &quot;Greensboro Coliseum&quot;,
                  &quot;status&quot;: &quot;FINISHED&quot;
              }
          ]
      }
  }
  </code></pre>
  <p>Expected:</p>
  <pre><code>[
      [{
              &quot;id&quot;: &quot;8cac353e-fb04-4a9a-b340-ed64e1094ff1&quot;,
              &quot;confrontationId&quot;: &quot;2f2c58c9-f1be-4914-8aee-03d00725a0be&quot;,
              &quot;arena&quot;: &quot;Tacoma Dome&quot;,
              &quot;status&quot;: &quot;FINISHED&quot;
          },
          {
              &quot;id&quot;: &quot;e23dc4ce-24de-4f7f-b5b0-9b124ec0e71a&quot;,
              &quot;confrontationId&quot;: &quot;2f2c58c9-f1be-4914-8aee-03d00725a0be&quot;,
              &quot;arena&quot;: &quot;Greensboro Coliseum&quot;,
              &quot;status&quot;: &quot;FINISHED&quot;
          }
      ],
      [{
          &quot;id&quot;: &quot;d8ff6322-824c-455c-b59d-d837d0188d93&quot;,
          &quot;confrontationId&quot;: &quot;41d85805-5571-42c6-a38e-e03fd8fcdc96&quot;,
          &quot;arena&quot;: &quot;Baku Crystal Hall&quot;,
          &quot;status&quot;: &quot;FINISHED&quot;
      }]
  ]
  </code></pre>