cancel
Showing results for 
Search instead for 
Did you mean: 

Transforming Multi-value Properties - Mistake

jamie_c
Node

Hi,
It's my understanding that the following isn't correct.
Coalesce is documented to return the first non-null from the given arguments. I assume in this case it's to stop the actual split operating on a null.

1 REPLY 1

glilienfield
Ninja
Ninja

The operation will return a list with an empty string as its sole element if your properties are null. If the coalesce is not used, the result of split(a, "|") with 'a is null' is a null value.

I would think which you use depends on your requirements. Do you prefer a null property or a property with a list containing an empty string.

You can experiment with the following cypher queries:

return split(coalesce(null, ""), "|") -> [""]
return split(null, "|") -> null

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.