title: Group multiple documents of facet
body: <p>I need to group my documents by _id, I made a query that is true when a match is valid to categorize my results, however each match generates a document, I would like to group all the documents of equal _id in one. Was there any other way to do that? When finding a specific condition of a match he will return me which condition he found</p>
  
  <p>I already tried using <code>$group:{_id:{"$_id"} }</code></p>
  
  <pre><code>db.collection('data').aggregate( [
      {
          $facet: {
              "teste1": [
                  { $match: { "estabelecimento": {$regex: palavra, $options:'i'} } },
                  { $addFields: { "teste1": true } }
              ],
              "teste2": [
                  { $match: { "nome": {$regex: palavra, $options:'i'} } },
                  { $addFields: { "teste2": true } }
              ],
              "teste3": [
                  { $match: { "tags": {$regex: palavra, $options:'i'} } },
                  { $addFields: { "teste3": true } }
              ]
          }
      }, {
          $project: { 
              "allDocuments" : { $setUnion: [ "$teste1", "$teste2", "$teste3" ] } 
          }
      }, {
          $unwind: "$allDocuments" 
      }, {
          $replaceRoot: { 
              newRoot: "$allDocuments"
          }
      }, {
          $project: { 
              "nome": 1,
              "seller_id":1,
              "descricao":1,
              "tags":1,
              "estabelecimento":1,
              "teste1": 1,
              "teste2":1,
              "teste3":1
          }
      }
  ])
  </code></pre>
  
  <p>My current result: </p>
  
  <pre><code>  {
      _id: 5d29e0f9942fdb56a515ffd4,
      seller_id: 10,
      nome: 'nescau',
      descricao: 'nescau eh muito gostoso',
      estabelecimento: 'Nescaleiro',
      tags: 'chocolate,nescaus,achocolatado',
      teste1: true
    },
    {
      _id: 5d29e0f9942fdb56a515ffd4,
      seller_id: 10,
      nome: 'nescau',
      descricao: 'nescau eh muito gostoso',
      estabelecimento: 'Nescaleiro',
      tags: 'chocolate,nescaus,achocolatado',
      teste2: true
    },
    {
      _id: 5d29e0f9942fdb56a515ffd4,
      seller_id: 10,
      nome: 'nescau',
      descricao: 'nescau eh muito gostoso',
      estabelecimento: 'Nescaleiro',
      tags: 'chocolate,nescaus,achocolatado',
      teste3: true
    }
  </code></pre>
  
  <p>I would like to receive:</p>
  
  <pre><code>  {
      _id: 5d29e0f9942fdb56a515ffd4,
      seller_id: 10,
      nome: 'nescau',
      descricao: 'nescau eh muito gostoso',
      estabelecimento: 'Nescaleiro',
      tags: 'chocolate,nescaus,achocolatado',
      teste1: true,
      teste2: true,
      teste3: true
    }
  </code></pre>