title: MongoDB query get count between two dates
body: <p>I have 10000's of data in my monogodb table, need write a query to get the count between two dates.  below is the response looks like from mongodb table </p>
  
  <pre><code>{ _id: 5942c8e366ae6b3aefb37232,
      serialnumber: 5523330044,
      model: ‘MODEL1’,
      version: 'EM.12.12.12',
      releasedata: '2017-06-01',
      modelid: 90000001,
      uiversion: 'EM.12.12.12',
      imageversion: 'EM.M1.M1.M1',
      ecnnumber: null },
    { _id: 5942c8e366ae6b3aefb37231,
      serialnumber: 5523330043,
      model: 'MODEL1',
      version: 'EM.12.12.12',
      releasedata: '2017-06-01',
      modelid: 90000001,
      uiversion: 'EM.12.12.12',
      imageversion: 'EM.M1.M1.M1',
      ecnnumber: null },
    { _id: 5942c8e366ae6b3aefb37233,
      serialnumber: 5523330045,
      model: 'MODEL1',
      version: 'EM.12.12.12',
      releasedata: '2017-06-01',
      modelid: 90000001,
      uiversion: 'EM.12.12.12',
      imageversion: 'EM.M1.M1.M1',
      ecnnumber: null },
    { _id: 5942c8e366ae6b3aefb37234,
      serialnumber: 5523330046,
      model: 'MODEL1',
      version: 'EM.12.12.12',
      releasedata: '2017-06-01',
      modelid: 90000001,
      uiversion: 'EM.12.12.12',
      imageversion: 'EM.M1.M1.M1',
      ecnnumber: null },
    { _id: 5942c8e366ae6b3aefb37235,
      serialnumber: 5523330047,
      model: 'MODEL1',
      version: 'EM.12.12.12',
      releasedata: '2017-06-01',
      modelid: 90000001,
      uiversion: 'EM.12.12.12',
      imageversion: 'EM.M1.M1.M1',
      ecnnumber: null },
    { _id: 5942c8e366ae6b3aefb37237,
      serialnumber: 5523330049,
      model: 'MODEL1',
      version: 'EM.12.12.12',
      releasedata: '2017-06-01',
      modelid: 90000001,
      uiversion: 'EM.12.12.12',
      imageversion: 'EM.M1.M1.M1',
      ecnnumber: null },
  </code></pre>
  
  <p>What i have tried, form the below code i got the count of "1000", but i actually need to write a query which give the count of registered devices form start and end dates.</p>
  
  <p>In the above response i have the releasedate key to query between dates.</p>
  
  <p>please help me in finding the solution.</p>
  
  <pre><code>app.post('/getTheCount', function (req, res) {
  
      var collection    =    gdb.collection('machine');
      var modelid       =    parseInt(req.body.modelid);
      collection.count({modelid:modelid}, function(error, numOfDocs) {
       console.log('I have '+numOfDocs+' documents in my collection');
       res.send({numOfDocs});
  
       });
  
   })
  </code></pre>
  
  <p>Thanks,</p>