title: MongoDB aggregation with $lookup to show only result of one field
body: <p>I'm trying to get only object pasien_docs in result of lookup, I using match, lookup and addfield but i want get result only show array of pasien_docs:</p>
  
  <pre><code>Pasien.aggregate(
    [
      {
        $match: {
          _id: ObjectId(id)
        }
      },
      {
        $lookup: 
        {
            from: "data",
            localField: "_id",
            foreignField: "idPasien",
            as: "pasien_docs"
        }
      },
      { '$addFields': {
        'pasien_docs': {
          '$map': {
            'input': '$pasien_docs',
            'in': {
              'ecg': '$$this.ecg',
              'date': '$$this.date'
            }
          }
        }
      }}
    ]
  )
  </code></pre>
  
  <p>and the result is :</p>
  
  <pre><code>    "data": [
      {
          "_id": "5e08a79fe34fa20a302f659f",
          "username": "rizkarahayus",
          "nama": "Rizka Rahayu",
          "__v": 0,
          "pasien_docs": [
              {
                  "ecg": null,
                  "date": "2020-01-21T05:22:01.901Z"
              },
              {
                  "ecg": 1.03,
                  "date": "2020-01-21T05:22:02.979Z"
              },
  </code></pre>
  
  <p>but i want result only show array of pasien_docs like this :</p>
  
  <pre><code>"pasien_docs": [
              {
                  "ecg": null,
                  "date": "2020-01-21T05:22:01.901Z"
              },
              {
                  "ecg": 1.03,
                  "date": "2020-01-21T05:22:02.979Z"
              },
  </code></pre>
  
  <p>can you help me? thank you...</p>