I want to get only the nodes if one certain predicate is undefined.
Golang default values don't get stored as of now, and changing the current DGraph configuration would be pretty difficult.
I could filter them in the code afterwards, but I would appreciate a better solution.
Check if a field is undefined in DGraph query
31 Views Asked by Dennis Gloss At
1
Forgot to answer it last time, forgot the solution and stumbled upon the same issue
As for now, there's no way to check for null/undefined directly. Use
ge
,gt
,le
,lt
functions.E.g. If the field's type is a number then use
not gt(field_name, 0)
. If it's a datenot gt(field_name, "1970-01-01T00:00:00Z")
and so on. If you use the default values, be creative.