Function ifnull()
judges if a value is null and returns an alternative value if true, or returns the original value if false.
When the two input columns are of different data types, data conversion might be triggered to guarantee a consistent data type in the final column.
Arguments:
- Any value <any>
- Alternative value <any>
Returns:
- Result <any>
If the value and the alternative value are non-homologous, Cartesian Product will be applied when the function is called in a WITH clause, or column length will be trimmed when called in a RETURN clause.
Comman Usage
Example: Find two products P001, P002 and two cards CA001 and CA002, return the product name or card number. Known that property @card.name does not exist
find().nodes({_id in ["P001", "P002", "CA001", "CA002"]}) as n
return coalesce(n.name, n._id)