I'm stuck on the following json with jq. The elements below are sorted descending by some timestamp (not included in the json). I need to select the ids before id X. E.g. select ids before id 1 should return 2, 3 and 5.
[
{
"id": 2,
"somekey": "somevalue"
},
{
"id": 3,
"somekey": "somevalue"
},
{
"id": 5,
"somekey": "somevalue"
},
{
"id": 1,
"somekey": "somevalue"
},
{
"id": 4,
"somekey": "somevalue"
}
]
Any idea how to do this in a one-liner with jq? Specifically the "select elements before" part.