I\'m beginning with mongodb, and I\'m trying to query my db that have this document format:
{ \"_id\" : ObjectId(\"520b8b3f8bd94741bf006033\"), \"value\" : 0
you can access the data of current timestamp from mongodb using nodejs
const collection1 = dbo.collection('customers'); var dateq = new Date(); collection1.find({ "Timestamp" : { $gt: new Date(dateq.getTime() - 6000)} }).toArray(function(err , docs){ console.log(docs); }
code end