I have a requirement that, I want to select max date from MongoDB using Query;
This is what I tried:
db.getCollection('rrr.backup').find({$max:'insTime'});
Getting the following error
Error: error: {
"$err" : "Can't canonicalize query: BadValue unknown top level operator: $max",
"code" : 17287
}
Can anyone suggest me that, how to get the result with $max operator