I have two time data here. one is from mongodb database which i finded by objectId. other one is currenttime. i put both in variables.. now i want to subtract the time value of database from current time.. here is some code which i tried. 

```
var mongo = require('mongodb');
var ObjectId = require('mongodb').ObjectID;
var lastUpdate = new Date();
var id = ObjectId("5a5ee7588a6a102398be8ada");
var MongoClient = require('mongodb').MongoClient;
var url = "mongodb://localhost:27017/blue";

MongoClient.connect(url, function (err, db) {
    if (err) 
        throw err;
    var dbase = db.db("blue");
    dbase.collection("screams").findOne({ email: "Adnan@gmail.com", _id: id }, 
     function (err, searchtype) {
        if (err) 
          throw err;
        var resdate = searchtype.createdAt;
        console.log(resdate);
        dbase.collection("screams").find(function () {
            return (this.lastUpdate.valueOf() - this.resdate.valueOf())
                > (1000 * 60 * 60 * 24);
        })
        db.close();
    });
});

```