0

I want to connect two nodes without specifying the connection type but It doesn't seem to be possible. Why must relationships have a type? I tried the following:

(n)->(p)
(n)-->(p)
(n)-[]->(p)
(n)-[]-(p)
(n)-[c]->(p)
(n)-[:DEFAULT]->(p) // this works

My current approach is sort of described here, I have a DEFAULT connection type and when I know the real type, I change it by deleting the old one and adding the new one.

viarnes
  • 2,018
  • 2
  • 19
  • 31

2 Answers2

0

Unfortunately It's not possible currently, you can name it anything (like you are doing currently by naming it default) at the time of creating it and then change it later.

Rajendra Kadam
  • 4,004
  • 1
  • 10
  • 24
0

Changing the relationship type is not possible in Cypher (at least for now). Did you consider setting a property on the relationship to distinguish different kinds of relationships? It comes with a performance cost, so it depends on the MATCHes you plan to do, as well as on the use case.

Graphileon
  • 5,275
  • 3
  • 17
  • 31