title: I am referencing one field from one collection to another. But whenever there are duplicate, the returned array is distinct
body: <pre><code>router.get('/orderSelect', (req, res, next) =&gt;{
      orderSchema.aggregate([   
          { $lookup:
              {
                  from: 'productschemas',
                  localField: 'orderItem.productId',
                  foreignField: '_id',
                  as: 'product'
              }
          }
      ], (err, orderSchema) =&gt;{
          if(err) res.json(err);
          else res.json(orderSchema);
      });
  });
  </code></pre>
  
  <p>productschemas: </p>
  
  <pre><code>[
    {
      "_id": "5ba26ff33318b51e20a80fb3",
      "productExist": true,
      "productName": "Oppo",
      "supplierId": "5b9f1e2f5929760568283f95",
      "brandId": "5b9d19e8316e8d2660f26394",
      "categoryId": "5b9d20de9c21fd1b78410d52",
      "productPrice": 4300,
      "productQuantity": 320,
      "productMax": 10,
      "productMin": 4,
      "productTimeStamp": "2018-09-19T15:49:07.177Z",
      "__v": 0
    }
  ]
  </code></pre>
  
  <p>orderSchema</p>
  
  <pre><code>[
    {
      "_id": "5ba79a638cef34091c143def",
      "orderItem": [
        {
          "_id": "5ba7a37b4c40dc24d8f4f403",
          "productId": "5ba26ff33318b51e20a80fb3",
          "productPrice": 4300,
          "productQuantity": 2,
          "productTotal": 8600
        },
        {
          "_id": "5ba7a37b4c40dc24d8f4f402",
          "productId": "5ba34f0c133e492a04731c49",
          "productPrice": 2000,
          "productQuantity": 1,
          "productTotal": 2000
        },
        {
          "_id": "5ba7a37b4c40dc24d8f4f401",
          "productId": "5ba26ff33318b51e20a80fb3",
          "productPrice": 4300,
          "productQuantity": 1,
          "productTotal": 4300
        }
      ]
    }
  ]
  </code></pre>
  
  <p>I want to reference from ordershemas collection the 'orderItem.productId' to collection productschema. i am just saving the object id, and i want to display on the screen the product name not just the id. but whenever there are duplicates, the returned 'product' array is not repeating, </p>