title: Dynamically Query a Mongo Collection in c#
body: <p>I'm new to C# mongo,earlier worked on Node and Mongo.
  i have a collection called tasks.Below is a sample record.</p>
  <pre><code>{
      &quot;_id&quot; : ObjectId(&quot;6193bfba23855443a127466a&quot;),
      &quot;taskIdentifier&quot; : LUUID(&quot;00000000-0000-0000-0000-000000000000&quot;),
      &quot;title&quot; : &quot;PR Liquidators&quot;,
      &quot;company&quot; : &quot;iuytreugdfh&quot;,
      &quot;purpose&quot; : &quot;test purpose&quot;,
      &quot;column&quot; : &quot;Search&quot;,
      &quot;assignTo&quot; : &quot;Shiva&quot;,
      &quot;assignToId&quot; : ObjectId(&quot;61933b47a79ac615648a7855&quot;),
      &quot;assignToImage&quot; : null,
      &quot;notes&quot; : &quot;ggh@William james &quot;,
      &quot;done&quot; : 0,
      &quot;taskID&quot; : &quot;00029&quot;,
      &quot;status&quot; : &quot;Pending&quot;,
      &quot;states&quot; : [ 
          &quot;Alabama - AL&quot;, 
          &quot;Alaska - AK&quot;
      ],
      &quot;active&quot; : true,
      &quot;updatedAtUtc&quot; : ISODate(&quot;2021-11-18T12:26:37.616Z&quot;),
      &quot;updatedBy&quot; : &quot;&quot;
  }
  </code></pre>
  <p>in my c# webapi Project i always get a array called filterCriteria from api request of below form:</p>
  <pre><code>filterCriteria=[
  {key:&quot;purpose&quot;,value:&quot;test purpose&quot;,type:&quot;eq&quot;},
  {key:&quot;active&quot;,value:true,type:&quot;eq&quot;}
  ]
  </code></pre>
  <p>Now I want to query the mongo collection tasks using the given <strong>filterCriteria</strong>.</p>
  <p>tried something using LINQ statements but no use --hardcoding works but dynamically not working.
  How can I achieve this???</p>