title: how to filter last 10 days records from mongoDb?
body: <pre><code>var require = require('moment');
  var today = new Date();
  var dd = today.getDate();
  var mm = today.getMonth()+1; //January is 0!
  
  var yyyy = today.getFullYear();
  
  if(dd&lt;10) {
    dd='0'+dd
  } 
  
  if(mm&lt;10) {   
    mm='0'+mm
  } 
  
  today = yyyy+'/'+mm+'/'+dd;
  console.log(today);
  videofiles.find({date:{$lte:'today'}}
  </code></pre>
  
  <p>Above mention is my code ..The below is my Db values..i do no how to filter last 10 days records from mongodb.
  I have mentioned the value of filter date as lesser than or equal to today but i really need to filter last 10 days of records and i am new to mongo db and node.js <code>videofiles</code> refers to the name of my collection in mongodb.</p>
  
  <pre><code>"date": "2017/03/10",
  "is_deleted": 0,
  "filemimeType": "audio/mp3",
  "emotionCount": 0,
  "originalname": "1489042167918-1489040146195-SampleAudio_0.5mb (1).mp3",
  "updatedAt": "2017-03-10T05:54:34.032Z",
  "isUserLiked": 0,
  "country": "India",
  "fileuploadFilename": "1489125273974-1489042167918-1489040146195-SampleAudio_0.5mb (1).mp3",
  "_id": "58c23f9a180ac54d758b5fc0",
  "likeCount": 0,
  "viewed": 0
  </code></pre>