title: MongoDB java querying
body: <p>I have a question, as I have a collection which stores data. Every record has Date in which was added to collection. My question is: I need to get how many items was added per day.I found some query on MongoDB webpage: </p>
  
  <p>db.orders.find( { ord_dt: { $gt: new Date('01/01/2012') } } ).count() </p>
  
  <p>I'm writing everything in Java and have no idea how to do it. Please be lenient, I have started playing with MongoDB week ago. Any help much appreciated.</p>
  
  <p>EDIT:
  I have found mongo aggregating thread on stack overflow in which user wants to count records by minute, as I want to count them for example in every day I suppose it should look like this:</p>
  
  <pre><code>db.so.insert( { date: new ISODate( "2013-08-05T15:24:15" ) } );
  db.so.insert( { date: new ISODate( "2013-08-05T15:24:19" ) } );
  db.so.insert( { date: new ISODate( "2013-08-05T15:24:25" ) } );
  db.so.insert( { date: new ISODate( "2013-08-05T15:24:32" ) } );
  db.so.insert( { date: new ISODate( "2013-08-05T15:24:45" ) } );
  db.so.insert( { date: new ISODate( "2013-08-05T15:25:15" ) } );
  db.so.insert( { date: new ISODate( "2013-08-05T15:25:15" ) } );
  
  db.so.aggregate( [
      { $group: {
          _id: {
              y: { '$year': '$date' },
              m: { '$month': '$date' },
              d: { '$dayOfMonth': '$date' },
          },
          count: { $sum : 1 }
      } } 
  ] );
  </code></pre>
  
  <p>However have no idea where to start with java implementation. Any advices please? :(</p>