title: How to query nested list with MongoDB C# Driver projections
body: <p>Suppose I have the following data in my MongoDB:</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;_id&quot;: {
      &quot;$oid&quot;: &quot;62baf9a2851424fdb8c226f8&quot;
    },
    &quot;Name&quot;: &quot;Team A&quot;,
    &quot;TeamData&quot;: {
      &quot;Players&quot;: [
        {
          &quot;FirstName&quot;: &quot;First Name A&quot;,
          &quot;LastName&quot;: &quot;Last Name A&quot;
        },
        {
          &quot;FirstName&quot;: &quot;First Name B&quot;,
          &quot;LastName&quot;: &quot;Last Name B&quot;
        }
      ]
    }
  }
  </code></pre>
  <p>I only want to query <code>LastName</code>. <code>FirstName</code> should be <code>null</code>.</p>
  <p>The query projection looks like this, using dot notation:</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;TeamData.Players.LastName&quot;: 1
  }
  </code></pre>
  <p>How can I do this using the C# driver's LINQ support? I was able to come close with the code below, but not quite.</p>
  <pre class="lang-cs prettyprint-override"><code>public IEnumerable&lt;TeamDto&gt; GetTeam()
  {
      return _collection.Find(filter).Project(x =&gt; new TeamDto
      {
          Id = x.Id,
          TeamData = new TeamDataDto
          {
              Players = x.TeamData.Select(y =&gt; new PlayerDto
              {
                  LastName = y.LastName
              })
          }
      });
  }
  </code></pre>
  <p>The result is: Players array is populated, but with <code>null</code> values. I also tried my hand at <code>Include</code> and <code>Exclude</code> inside <code>.Project()</code>, also to no avail. Can anyone shed a light?</p>
  <p><strong>Edit</strong>: My question is actually very similar to <a href="https://stackoverflow.com/questions/42918456/how-to-projection-element-in-array-field-of-mongodb-collection">this one</a>, but using LINQ instead. I know there's a way to put dot notation in <code>.Project</code>, but that's also not want I want. Thanks.</p>