简体   繁体   中英

How to change ELABEL on AgensGraph?

I want to change elabel of edge.

agens=# create (:v1{id:1})-[:e1{id:3}]->(:v1{id:2});
GRAPH WRITE (INSERT VERTEX 2, INSERT EDGE 1)
agens=# match ()-[r1:e1{id:3}]->() set r1:v2 remove r1:v1;
ERROR:  syntax error at or near ":"
LINE 1: match ()-[r1:e1{id:3}]->() set r1:v2 remove r1:v1;
                                         ^

But, there is an error on it.

How to change ELABEL on AgensGraph?

There is no way to change label on edge on AgensGraph.

But, You can try add new edge with same properties and remove old edge.

agens=# create (:v1{id:1})-[:e1{id:3}]->(:v1{id:2});
GRAPH WRITE (INSERT VERTEX 2, INSERT EDGE 1)
agens=# match p = ( (n1)-[r1]->(n2) ) return p;
                               p                               
---------------------------------------------------------------
 [v1[3.1]{"id": 1},e1[4.1][3.1,3.2]{"id": 3},v1[3.2]{"id": 2}]
(1 row)

agens=# match  (n1)-[r1:e1{id:3}]->(n2)
        create (n1)-[r2:e2]->(n2)
        set    r2 = properties(r1)
        delete r1;
GRAPH WRITE (INSERT VERTEX 0, INSERT EDGE 1, DELETE VERTEX 0, DELETE EDGE 1, UPDATE PROPERTY 1)
agens=# match p = ( (n1)-[r1]->(n2) ) return p;
                               p                               
---------------------------------------------------------------
 [v1[3.1]{"id": 1},e2[5.1][3.1,3.2]{"id": 3},v1[3.2]{"id": 2}]
(1 row)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM