title: Pipeline in lookup aggregation not working in mongodb
body: <p>I am new to mongodb so I hope this does not come-off as a very elementary question. I've done some research and tried to apply what I've found but something just seems to escape me.</p>
  
  <p>I have two collections of the following format: </p>
  
  <pre><code>-----------------------------------------------------------------------
  Shop
  -----------------------------------------------------------------------
  {
      "shopId": "1002",
      "shopPosId": "10002",
      "description": "some description"
  }
  
  -----------------------------------------------------------------------
  Compte
  -----------------------------------------------------------------------
  {
      "shopId": "9000",
      "shopPosId": "0000",
      "clientUid": "474192"
  }
  </code></pre>
  
  <p>I want to join those and before doing so, I want to filter out the <code>Shop</code>s which do not have the <code>shopPosId</code> field. </p>
  
  <p>Here's my code: </p>
  
  <pre><code>Compte.aggregate([
      {
          $match:
              { 
                  $and:[{"clientUid":clientUid}]
              }
      },
      {      
          $lookup:
          {
              from: "Shop",
              localField: "shopId",
              foreignField: "shopId",
              let: {"Shop.shopPosId": "$shopPosId"},
              pipeline: [{$match: {"shopPosId": {"$exists": false}}}],
              as: "shopDescr"
          }
          }]
  );
  </code></pre>
  
  <p>the returned result is an <code>undefined</code>, which means the query doesn't make much sense (because in fact I should at least get a void array). </p>
  
  <p>Is this because the two collections have the <code>shopPosId</code> field? (if so, isn't this line <code>let: {"Shop.shopPosId": "$shopPosId"}</code> supposed to take care of it ?)</p>