cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Cypher tip for count words in a property

gigauser
Graph Buddy

I found it by wasting time:
match (t:Text)
set t.count = size(split(t.text)) => worked but not for the empty case like "".
In this case size returns 1 not 0.

To avoid this, I had to change the query like this:
match (t:Text) where size(t.text) = 0
set t.count = 0

match (t:Text) where not t.count = 0
set t.count = size(split(t.text))

0 REPLIES 0