I am trying to write a custom function which would work on a schema that is not fixed (it may follow some tag naming convention for example). I wonder if it is possible because when I try a simple predicate in filter() such as
data
|> filter(fn: (r) =>
if precision == 4 and exists r._g4 then contains(value: r._g4, set: values)
else if precision == 8 and exists r._g8 then contains(value: r._g8, set: values)
else false
)
with ‘exists’ operator, I still get error whenever a referenced property (tag _g8 in this example) is not present in input table, despite the ‘if exists’ condition should resolve to false for missing property, I assume…
Result: _result
Error: cannot add type constraint @ 4:17-7:12: type error 0:0-0:0: missing object properties (_g8)