title: C# mongo queries with json strings
body: <p>This seems so basic that I'm sure I've just overlooked a class or a method somewhere, but for the life of me, I can't find it.</p>
  
  <p>I've got a json string like so:</p>
  
  <pre><code>{ SendId: 4, "Events.Code" : { $all : [2], $nin : [3] } }
  </code></pre>
  
  <p>I can run this in the mongo shell against a <code>find()</code> or a <code>count()</code> and get what I'm looking for.
  What is the easiest way to deal with this in C#? Here's what I've found:</p>
  
  <ul>
  <li>The methods I'm finding are all wanting an <code>IMongoQuery</code>, which is just a marker interface</li>
  <li><code>BsonDocument</code> has a nice Parse method, but it doesn't implement <code>IMongoQuery</code></li>
  <li><code>QueryDocument</code> inherits from <code>BsonDocument</code>, and it does implement <code>IMongoQuery</code>, but it does not have it's own Parse method, and I can't convert the <code>QueryDocument</code> to <code>BsonDocument</code></li>
  <li>The Aggregation framework takes a <code>BsonDocument</code>[], but sometimes I just want a simple Find or Count operation</li>
  <li>Some of these queries are large and gross, and I don't want to build them a line a time with the <code>Query</code> builder class</li>
  </ul>
  
  <p>If the database deals with json documents, and I can run this stuff in the shell, isn't there some way to run it through the driver?</p>