title: MongoDB - filter in find function
body: <p>I am writing a query in mongo db. I want to know that how do I use substring function in find function, like I have a date string. I want to filter the date by year and then group by month.
  This is what I have tried:</p>
  
  <pre><code>db.booking.find({$substr:["$bookingdatetime",5,2]:"14"}).aggregate([     {$group: {         _id: {$substr: ['$bookingdatetime', 5, 2]},          numberofbookings: {$sum: 1}     }} ])
  </code></pre>
  
  <p>Where am I going wrong ? </p>