I have a string like:
"The sky is blue."and a JSON file like
[ {"id": 1234,"name": "Entry 1","keywords": ["orange","yellow" ] }, {"id": 2345,"name": "Entry 2","keywords": ["red","blue","pink" ] }, {"id": 3456,"name": "Entry 3","keywords": ["green","blue","black" ] }]I want to return the first element which has a keyword that can be found in the string.
In this case I would like to have the element with the id 2345, because the keyword "blue" occurs in the string, and it is the first match.
Is there a one-line solution with JQ (e.g. with various pipes)? I'm not looking for a solution with loops.