pretty simple question, is there a way to get length of a string in Neo4j cypher? I cannot find any document for that.
thanks
In Neo4j database, COUNT() function is used to count the number of rows. Syntax: MATCH (n { name: 'A' })-->(x) RETURN n, count(*)
The function coalesce() returns the first non- null value in the given list of expressions. Syntax: coalesce(expression [, expression]*) Returns: The type of the value returned will be that of the first non- null expression.
The WITH clause allows query parts to be chained together, piping the results from one to be used as starting points or criteria in the next. It is important to note that WITH affects variables in scope.
To return the length of a string in Cypher, use the SIZE()
function. The LENGTH()
function is now exclusively used for measuring PATHs in the graph.
RETURN size("This is an example string")
yields 25
From the good folks at Neo: "This feature is deprecated and will be removed in future versions. Using length
on anything that is not a path is deprecated, please use size
instead"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With