I have a list of values that I want to select by in my JQ. That is, my JSON looks something like this:
[
{
"id": "a"
},
{
"id": "b"
},
{
"id": "z"
}
]
My list of values is something like a b c
. This list is stored as a scalar variable in bash (not hardcoded). How can I select the corresponding objects from the JSON from this list of values?
I have seen other questions about using a value to select something in a JQ query, but before this I had not seen an example of selecting in JQ based on multiple values. e.g. Select JSON where they're in a given list of values.