title: Symfony 2 DoctrineMongoDBBundle generates strange queries
body: <p>I'm using DoctrineMongoDBBundle and want to get some records. In my repository class I have code:</p>
  <pre><code>return $this-&gt;createQueryBuilder()-&gt;field('categories.data')
      -&gt;equals($categoryId)-&gt;getQuery()-&gt;execute();
  </code></pre>
  <p>In profiler's log it generates absolutely working query:</p>
  <pre><code>db.recipe.find({ &quot;categories.data&quot;: 16 }).sort([ ]);
  </code></pre>
  <p>When I run this query via console client it returns me record. <strong>But repository class get's nothing.</strong></p>
  <p>My server's log looks like this:</p>
  <pre><code>query test_database.recipe query: { $query: { categories.data: &quot;2&quot; }, $orderby: {} } ntoreturn:0 keyUpdates:0 nreturned:0 reslen:20 0ms
  </code></pre>
  <p>But if i run plain PHP script to get same data:</p>
  <pre><code>&lt;?php 
  $mongo = new Mongo();
  $col = $mongo-&gt;test_database-&gt;recipe;
  
  foreach ($col-&gt;find(array(&quot;categories.data&quot; =&gt; 2)) as $r) {
    print_r($r);
  }
  </code></pre>
  <p>I got result and server's log looks like this:</p>
  <pre><code>query test_database.recipe query: { categories.data: 2 } ntoreturn:0 keyUpdates:0 nreturned:1 reslen:1037 0ms
  </code></pre>
  <p>so difference is:</p>
  <blockquote>
  <p>query test_database.recipe query: { <strong>$query:</strong> { categories.data: &quot;2&quot; }, <strong>$orderby</strong>: {} } ntoreturn:0 keyUpdates:0 <strong>nreturned:0</strong> reslen:20 0ms</p>
  <p>query test_database.recipe query: { categories.data: 2 } ntoreturn:0 keyUpdates:0 <strong>nreturned:1</strong> reslen:1037 0ms[/quote]</p>
  </blockquote>
  <p>Checked both MongoDB 2.1.1 and 1.8.1, <strong>deps</strong> file:</p>
  <pre><code>[symfony]
      git=http://github.com/symfony/symfony.git
      version=origin/2.0
  
  [doctrine-common]
      git=http://github.com/doctrine/common.git
      version=2.2.2
  
  [doctrine-dbal]
      git=http://github.com/doctrine/dbal.git
      version=2.1.7
  
  [doctrine]
      git=http://github.com/doctrine/doctrine2.git
      version=2.1.7
  
  [doctrine-mongodb-odm]
      git=http://github.com/doctrine/mongodb-odm.git
  
  [DoctrineMongoDBBundle]
      git=http://github.com/doctrine/DoctrineMongoDBBundle.git
      target=/bundles/Symfony/Bundle/DoctrineMongoDBBundle
      version=origin/2.0
  </code></pre>