title: Query MongoDb document by nested element
body: <p>I am trying to find the syntax to delete a mongoDB record using PHP, but every example I find on internet only shows how to do it if the deletion criteria is one level...</p>
  
  <p>So if I have a mongoDB record like this:</p>
  
  <pre><code>{ 
          "_id" : ObjectId("50d69d6a1d26a8a0c1eaecf8"), 
          "name" : "John",
          ...other fields...
  </code></pre>
  
  <p>The I can delete it using the syntax:</p>
  
  <pre><code>$collection-&gt;remove(array('name' =&gt; 'John'));
  </code></pre>
  
  <p>This is fine, however my problem is that the key I need to lookup for deletion is one more level down.</p>
  
  <p>So I have a record that looks like this:</p>
  
  <pre><code>{
      "_id" : ObjectId("54f2aaa3452a235c049000029"),
      "synthOrder" : {
          "orderId" : "899422",
          ...other fields...
  </code></pre>
  
  <p>I want to delete records in which orderId is say, 899422.
  So what would my deletion line be like?</p>
  
  <p>I tried:</p>
  
  <pre><code>$collection-&gt;remove(array('synthOrder' =&gt; array('orderId' =&gt; '899422')));
  </code></pre>
  
  <p>I feel it is a simple syntax issue, but I am not able to find any example online. I appreciate any pointers!</p>