I have a JSON
a = {
cake: ["a","b","c","d"]
}
I need to query any value in a given values are present in the array
Like if the input is ["a","x"]
output should be true
if input is ["c","d"] then output is true
if input is ["x","z"] the n output is false
2
Answers
Use intersection (&) and check if any of input is in the original array:
simply try to find common between json array and input array.