title: How can I get actual query from MongoCollection?
body: <p>I using a MongoCollection as following code :</p>
  <pre><code>MongoDatabase conn = getMongoConnection(DbName);
  MongoCollection collection = conn.getConnection(CollectionName);
  
  List&lt;BasicDBObject&gt; query = new ArrayList();
  
  if (searchKey.containsKey(&quot;filter1&quot;)) {
     String filter1= (String) searchKey.get(&quot;filter1&quot;);
     query.add(new BasicDBObject(&quot;filter1&quot;, filter1));
  }
  
  if (searchKey.containsKey(&quot;filter2&quot;)) {
     String filter2= (String) searchKey.get(&quot;filter2&quot;);
     query.add(new BasicDBObject(&quot;filter2&quot;, filter2));
  }
  
  int rowAmount = (int) collection.count(new BasicDBObject(&quot;$and&quot;, query));
  </code></pre>
  <p>rowAmount gets the correct amount of data, but I want to know an actual query when it got the result. Any ideas how?</p>