I'm querying to Oplog using mongoose in node.js, to get the timestamp of the last oplog record using the following code:
oplogModel.find().sort('-ts').limit(1).select('ts').exec(function(err, res){
if (err) {console.log(err);}
lastTimestamp=res[0];
console.log(JSON.stringify(lastTimestamp));
});
But the output I'm getting is {"ts":"6260013777081597954"}
When I run this in mongo shell,
rs0:PRIMARY> db.oplog.rs.find({}, {ts:1, _id:0}).sort({ts:-1}).limit(1);
I get : { "ts" : Timestamp(1457523037, 2) }
How can I convert {"ts":"6260013777081597954"}
to epoch time or iso time?
What format is this timestamp in?