title: $match in $lookup result
body: <p>I have next mongo code:</p>
  
  <pre><code>db.users.aggregate([
      { 
          $match: { 
              $and: [
                  { UserName: { $eq: 'administrator' } }, 
                  { 'Company.CompanyName': { $eq: 'test' } }
              ]                   
          } 
      },
      { 
          $lookup: { 
              from: "companies", 
              localField: "CompanyID", 
              foreignField: "CompanyID", 
              as: "Company" 
          } 
      },
  ])
  </code></pre>
  
  <p>The <code>$lookup</code> part of the code working great. I got next result:</p>
  
  <p><a href="https://i.stack.imgur.com/lcWdC.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lcWdC.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/svnc0.png" rel="noreferrer"><img src="https://i.stack.imgur.com/svnc0.png" alt="enter image description here"></a></p>
  
  <p>But if I add <code>$match</code> to the code, it brings nothing.</p>
  
  <p>I found that the problem is in the second match:  <code>{ 'Company.CompanyName': { $eq: 'test' } }</code>, but I can not realize what is wrong with it.
  Any ideas?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I had also tried <code>$unwind</code> on the <code>$lookup</code> result, but no luck:</p>
  
  <pre><code>db.users.aggregate([
      { 
          $match: { 
              $and: [
                  { UserName: { $eq: 'administrator' } }, 
                  { 'Company.CompanyName': { $eq: 'edt5' } }
              ] 
          } 
      },
      {   unwind: '$Company' },
      { 
          $lookup: { 
              from: 'companies', 
              localField: 'CompanyID', 
              foreignField: 'CompanyID', 
              as: 'Company' 
          } 
      },
  ])
  </code></pre>