title: Mongodb aggregation lookup with conditions
body: <p>I have a collection called <code>article_category</code> which store all <code>article_id</code> belongs to the category with <code>category_id</code> with data format like so.</p>
  
  <p><strong>Collection 1: article_category</strong></p>
  
  <pre><code>{
    "article_id": 2015110920343902,
    "all_category_id": [5,8,10]
  }
  </code></pre>
  
  <p>Then I have other collection called <code>article</code> which store all my post</p>
  
  <p><strong>Collection 2: article</strong></p>
  
  <pre><code>{
    "title": "This is example rows in article collection"
    "article_id": 2015110920343902,
  },
  {
    "title": "Something change"
    "article_id": 2015110920343903,
  },
  {
    "title": "This is another rows",
    "article_id": 2015110920343904,
  }
  </code></pre>
  
  <p>Now I want to perform MongoDB query to find <code>title</code> with <code>regex</code> while <code>category_id</code> must equal to <code>8</code>. Here is my query but is not work.</p>
  
  <pre><code>db.article.aggregate(
  {
    $match: 
    {
      title: 
      {
         $regex: /example/
      }
    }
  },
  {
      $lookup:
         {
           from: "article_category",
           pipeline: [
              { $match: { category_id: 8 } }
           ],
           as: "article_category"
         }
    }
  )
  </code></pre>
  
  <p>Above query only show the records which match by <code>regex</code> but not match by <code>category_id</code>.</p>
  
  <p>Any idea?</p>