title: Mongodb lookup aggregation does not return relational data
body: <p>I am trying to use lookup aggregation in Mongodb to simulate join in Mongodb and return relational value. But it only returns value from the current collection and not from the collection related to it.</p>
  
  <p>I have 2 collections called <code>wish_list</code> and <code>products</code> that are related. <code>wish_list</code> contains products that has been marked as wish list, and it contains product_id from the products collection.</p>
  
  <p>The document of <code>wish_list</code> is like this:</p>
  
  <pre><code>"_id"
  "product_id"
  "user_id"
  "created_at"
  </code></pre>
  
  <p>As you see, the <code>product_id</code> exists in this collection which is the <code>id</code> from <code>products</code> collection.</p>
  
  <p>The problem is when I try to query data from <code>wish_list</code> and I want related data from that product in <code>products</code> collection. It only returns data from <code>wish_list</code> collection (Result from products collection is empty array).</p>
  
  <p>Here is query that I execute:</p>
  
  <pre><code>db.wish_list.aggregate([
    {$match: {
      user_id: "crawler"}
    }, 
    {$lookup: {
      from: "wish_list", 
      localField: "product_id",
      foreignField: "id",
      as: "products"}
    }
  ])
  </code></pre>
  
  <p>and the result is this:</p>
  
  <pre><code>{
      "_id" : ObjectId("5a03024551195204432afcb6"),
      "product_id" : "com.thundanapps.thundpusthakam",
      "user_id" : "crawler",
      "created_at" : 1510146629,
      "products" : []
  }
  
  /* 2 */
  {
      "_id" : ObjectId("5a0302565119520442375786"),
      "product_id" : "com.jott.android.jottmessenger",
      "user_id" : "crawler",
      "created_at" : 1510146646,
      "products" : []
  }
  </code></pre>
  
  <p>P.S: I am pretty sure that the equivalent data exists in <code>products</code> collection.</p>
  
  <p>P.S: The same problem exists when I try vice o versa (query from <code>products</code> collection to <code>with_list</code>).</p>