title: Doctrine - How to print out the real query string to mongodb?
body: <p>I'm using MongoDB ODM and try to query:</p>
  
  <pre><code>$this-&gt;dm-&gt;createQueryBuilder($this-&gt;documentName)-&gt;select(['_id', 'name', 'created_date'])-&gt;field('active')-&gt;equals(true)-&gt;getQuery();
  </code></pre>
  
  <p>I want to see what it is sending to the MongoDB? With Doctrine ORM you can do it like: <code>$query-&gt;getSql();</code> or <code>$query-&gt;getParameters()</code>.</p>
  
  <p>Thanks in advance!</p>
  
  <p><strong>UPDATED:</strong> 
  If I have query like above and execute <code>$queryBuilder-&gt;getQuery()-&gt;getQuery()</code>;</p>
  
  <p>Recieve array like:</p>
  
  <pre><code>[
    "type" =&gt; 1
    "select" =&gt; array:3 [
      "_id" =&gt; 1
      "name" =&gt; 1
      "created_date" =&gt; 1
    ]
    "query" =&gt; array:1 [
      "active" =&gt; true
    ]
   "newObj" =&gt; []
  ]
  </code></pre>
  
  <p>Which means: </p>
  
  <pre><code>db.getCollection('campaigns').find( { active: true }, { _id: 1, name: 1, created_date: 1})
  </code></pre>
  
  <p>Thank you @Alex Blex</p>