title: Searching Dates and Ignoring time and date in mongoDB node.js
body: <p>I am using node.js and monodb database where I want to query records based on date and I want to ignore time and date only month and year will be matched here is my code:-</p>
  
  <pre><code>  collection.find({ date: { "$gte": sDate, "$lt": eDate) } }).count(function (e, c) {
   });
  </code></pre>
  
  <p>this is working but matching date and time as well how I can match only month and year? Please help me to solve this problem.</p>
  
  <p>Edit:- some data from collection:-</p>
  
  <pre><code>{
  "_id" : ObjectId("5535e76f82a964d011e34fcf"),
  "VisitorId" : "5535e72a82a964d011e34fcb",    
  "date" : ISODate("2015-01-21T06:00:15.761Z"),
  }
  
  {
  "_id" : ObjectId("5535e75f82a964d011e34fcf"),
  "VisitorId" : "5535e72a82a964d011e34fcb",    
  "date" : ISODate("2015-04-21T06:00:15.761Z"),
  }
  </code></pre>
  
  <p>I will pass two params i.e {month:"1",year:"2015"};</p>
  
  <p>and in output first docs should be display. </p>
  
  <p>Thanks</p>