title: How do I select an object from a list MongoDB MVC
body: <p>I have the following data structure:</p>
  <pre><code>[
    {
      &quot;id&quot;: &quot;604ab2c4a568b9181987c9eb&quot;,
      &quot;name&quot;: &quot;Paul&quot;,
      &quot;eventDate&quot;: &quot;2021-03-12T00:16:03.672Z&quot;,
      &quot;created&quot;: &quot;2021-03-12T00:16:03.673Z&quot;,
      &quot;images&quot;: [
        {
          &quot;id&quot;: &quot;604ab2c3a568b9181987c603&quot;,
          &quot;name&quot;: &quot;DSC_0&quot;,
          &quot;url&quot;: &quot;https://picsum.photos/300/300&quot;,
          &quot;isSelected&quot;: true
        },
        ...
      ]
    },
    {
      &quot;id&quot;: &quot;604ab3889c5ac2289b450e3c&quot;,
      &quot;name&quot;: &quot;Paul&quot;,
      &quot;eventDate&quot;: &quot;2021-03-12T00:16:03.672Z&quot;,
      &quot;created&quot;: &quot;2021-03-12T00:16:03.673Z&quot;,
      &quot;images&quot;: [
        {
          &quot;id&quot;: &quot;604ab3879c5ac2289b450a54&quot;,
          &quot;name&quot;: &quot;DSC_0&quot;,
          &quot;url&quot;: &quot;https://picsum.photos/300/300&quot;,
          &quot;isSelected&quot;: true
        },
        ...
      ]
    },
    ...
  ]
  </code></pre>
  <p>and im trying to get the image by the user id and the image id, but i cant for some reason</p>
  <pre><code>var filter = Builders&lt;Client&gt;.Filter.Eq(&quot;Id&quot;, &quot;604ab2c4a568b9181987c9eb&quot;);
  filter &amp;= Builders&lt;Client&gt;.Filter.ElemMatch(u =&gt; u.Images,t =&gt; t.Id == &quot;604ab2c3a568b9181987c603&quot;);
  return _client.Find(filter).FirstOrDefault();
  </code></pre>
  <p>This is giving me back all the document with the id &quot;604ab2c4a568b9181987c9eb&quot;, but i just wanted to receive the image with the id &quot;604ab2c3a568b9181987c603&quot;</p>
  <p>Here the models of the objects:</p>
  <pre><code>public class Client
  {
      [BsonId]
      [BsonRepresentation(BsonType.ObjectId)]
      public string Id { get; set; }
  
      [BsonElement(&quot;name&quot;)]
      public string Name { get; set; }
  
      [BsonElement(&quot;eventDate&quot;)]
      [BsonDateTimeOptions]
      public DateTime EventDate { get; set; }
  
      [BsonElement(&quot;created&quot;)]
      [BsonDateTimeOptions]
      public DateTime Created { get; set; }
  
      [BsonElement(&quot;images&quot;)]
      public List&lt;Image&gt; Images { get; set; }
  }
  
  public class Image
  {
      [BsonId]
      [BsonRepresentation(BsonType.ObjectId)]
      public string Id { get; set; }
  
      [BsonElement(&quot;name&quot;)]
      public string Name { get; set; }
  
      [BsonElement(&quot;url&quot;)]
      [DataType(DataType.ImageUrl)]
      public string Url { get; set; }
  
      [BsonElement(&quot;isSelected&quot;)]
      public bool IsSelected { get; set; }
  }
  </code></pre>
  <p>So i wanted to know how could i fix my code to make it give me back just an image, or more than one images from the user im searching.</p>
  <p>Last but not least, i wanted to know if i can change the isSelected value even if im using the same filter.</p>