I have mongoDB collection with columns filename and text
I want to extract timestamp of latest document using pymongo
What I Tried:
from pymongo import MongoClient
host = "127.0.0.1:27017"
client = MongoClient(host)
# print(client)
# Getting a database
db = client['ResumeParsing']
# Getting a collection
coll = db.Resume
print(coll.find({"_id": {"$gt": 1}}).sort([("_id", 1), ("date", -1)]))
Which is giving me output as :
<pymongo.cursor.Cursor object at 0x00000187738CD860>
While I want datetime as a result.