title: Adding/Subtracting days to ISODate in MongoDB Shell
body: <p>I have a query where I need to get events that are one day before or after from a specific date. I need to add or subtract one day to that ISODate variable. Here is my query : </p>
  
  <pre><code>db.event.find().forEach( function (x) {
  
    print("x : " + x.EventID + ", " + x.ISODate); 
    db.events.find( {
     "$or" : [{
         "StartDate" : { "$gte" : x.ISODate } // Here i need to subtract one day
         }, {
             "EndDate": { "$lt" : x.ISODate} // Here i need to add one day
             }]
  }).forEach(function(otherDay) {
          print("x.EventID : " + x.EventID + ", other.Date : " + otherDay.StartDate + " - " + otherDay.EndDate);
        });
  
  });
  </code></pre>
  
  <p>How can i add or subtract days to an ISODate variable in mongodb shell?</p>