I have a JSON file in this format:
[
{
"id": 227,
"duration": "02:52:58"
},
{
"id": 226,
"duration": "01:30:41"
}
...
]
The duration field represents lengths of videos in HH:MM:SS format.
I need to find out the id that has the longest duration. I tried using sort and limit but that returns incorrect results.
// This doesn't work
(
sort: { fields: [duration], order: DESC }
limit: 1
)
What would be the best approach here?