I have 2 json files: a_names.json and b_names.json.
File a:
{
"Names": ["a","b","c"]
}
File b:
{
"Names": ["b","c"]
}
What i tried to do was (say i have a loop with counter ascending from 0):
a_names.Names | contains([b_names.Names[.counter]])
And the output is an error: Cannot index string with string.
However, next code provides a proper boolean output:
a_names.Names | contains(["b"])
My colleague said it’s happening due to me trying to refer to array 2 while being inside of the array 1, but we can’t find a solution.
P.S. – Same happens with any other “search” function, such as “any”,”IN”, etc…
V1st is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.