Aerodynamika
Aerodynamika

Reputation: 8413

How to add to a string value of a property instead of rewriting it in Cypher Neo4J?

Suppose I make a request in Neo4J (3.5) Cypher and I want to rewrite the last letter of the value in the property of a node rather than rewriting it.

I do add a string with the following request, but how to replace the last letter "a" for example with "o" and then add the string after?

MATCH (c:Context{name:'lisaksa'}) WITH c.name AS cname, c SET c.name = cname + '_new';

Upvotes: 0

Views: 243

Answers (1)

Graphileon
Graphileon

Reputation: 5385

Try this:

MATCH (c:Context{name:'lisaksa'}) 
SET c.name = left(c.name,size(c.name)-1) + 'o'+'_new'

Upvotes: 1

Related Questions