I have a document in a collection:
{
_id: ObjectId('5eaf27de2239a42991561b55'),
username: 'ScarVite',
userId: '1',
Id: 1,
claimed: false,
done: false,
originalMessageId: '706601433004376094',
channelId: '612965560501796864',
sentMessageId: '706601435688861717',
updated_at: ISODate('2020-05-03T20:21:50.528Z')
}
I Want to get the Document associated with the highest value of the variable Id .
I know, that i could get all documents in the collection and sort them by this value, but i believe there is a better/ more beautiful way of doing this.