I have the following structure:
"my-map": {
"my-key1": {
"field-to-find": {}
},
"my-key2": {
"field-to-find": {}
},
"my-key3": {}
}
I want to check if field-to-find exists in any of the values of my-map. Is this possible?
Things I tried:
- Using
my-map.exists(i, has(i.field-to-find))-> doesn't work becauseireturns just the key, not the value of the map - Using
my-map.exists(i, has(my-map.i.field-to-find))-> doesn't work becauseiis treated as a string, is there a way to reference it as a variable?
I figured out
mymap.exists(v, has(mymap[v].fieldtofind))works.