I’m using MongoDBLibrary and i would like to retrieve the latest document inserted from a collection.
i have python code that can get it -
def retrieveLatestDocument(mongoConnection, dbName, collectioName):
myclient = pymongo.MongoClient(mongoConnection)
mydb = myclient[dbName]
mycol = mydb[collectioName]
mydoc = mycol.find().sort("_id",-1).limit(1)
i would like to perform it on robot framework.
MongoDBLibrary.Retrieve Mongodb Records With Desired Fields BUT could not find the right ‘recordJSON’ to get the latest document from collection
is there a way to do it in robot framework?