Setting null value on predicate, and how has(predicate) and orderasc/desc or filter will effect results?


i found in doc that if a field is set to null, its as like deleted the predicate from that object.
for example updated_at = null

if i were to sort a list of objects by updated_at, will it return records with updated_at set to null?

if it does not return those records, means i have to set it to something that means empty right?
if yes, what are the default values for null for all different data type of dgraph?
int = 0?
dateTime = ?
string = “” ?
float = 0.0 ?
bool = false ? no null?

No, in this case don’t erase that predicate. Set your node as “deleted” (label) or filter it somehow. For now sorting works better if the predicate has something valid for indexing. Try always to set as the type indexed. Null isn’t a “type”.


1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.