I have a collection like this:
{ \'datetime\': some-date, \'lat\': \'32.00\', \'lon\': \'74.00\' }, { \'datetime\': some-date, \'lat\': \
Use sort and limit:
db.col.find().sort({"datetime": -1}).limit(1)
For node.js you can use the findOne() function:
node.js
findOne()
db.collection('yourCollectionName').findOne( {}, { sort: { datetime: -1 } }, (err, data) => { console.log(data); }, );