Warasint
Warasint

Reputation: 79

How can I rename property in the Neo4j web admin application?

I have created a relationship (for example "KNOWS") between 2 nodes on the Neo4j webAdmin application. If I want to rename the relationship (from "KNOWS" to "LOVES"), how can I do it?

The solution I have so far is delete the "KNOWS" relationship and create a new "LOVE" relationship. Is there any easier way to do this?

Thanks,

Upvotes: 0

Views: 1060

Answers (2)

Sushil Jain
Sushil Jain

Reputation: 507

If you are using the Embedded neo4j then renaming is not possible. For this, you'll have to delete the existing relationship b/w nodes and then create new relationship b/w same nodes again. Make sure you all do this in a transaction.

Regards,
Sushil Jain
Click here

Upvotes: 0

Peter Neubauer
Peter Neubauer

Reputation: 6331

Yes, that is how you do it. In the cypher console, you can do

start n=node(1) match n-[r:KNOWS]->m create n-[:FRIEND]->m delete r

see http://tinyurl.com/7umvpro for an example.

Upvotes: 2

Related Questions