How to move a vertex and maintain relations

34 views
Skip to first unread message

CasperCLD

unread,
Mar 19, 2015, 10:19:54 AM3/19/15
to orient-...@googlegroups.com
The title pretty much says all. I want to move a record in OrientDB from the 'Asset' class to a new class (that keeps the old version of the class 'Asset'). This is possible with MOVE VERTEX x to y. However this creates a new @RID for the node and I don't want to update all relations of the old RID to the new @RID, because this is too expensive.
Is there a solution for this?
Any help is greatly appreciated, if you need more info, please do ask.

odbuser

unread,
Mar 19, 2015, 10:55:41 AM3/19/15
to orient-...@googlegroups.com
OrientDB 2.0.5

MOVE doesn't work at all for me... but even if it did, are you sure it's supposed to keep copy and create a new rid?   I wouldn't think so but I can't verify it.

create class A extends V
Class created successfully...

create
class B extends V
Class created successfully...

create vertex A
Created vertex 'A#15:0 v1' in 0.002000 sec(s).

move vertex
( select from A ) to CLASS:B

select from B
0 item(s) found. Query executed in 0.0 sec(s).



CasperCLD

unread,
Mar 19, 2015, 11:00:01 AM3/19/15
to orient-...@googlegroups.com
In the web UI I execute:
And the result is:
{
    "result": [
        {
            "@type": "d",
            "@version": 0,
            "old": "#12:0",
            "new": "#16:0",
            "@fieldTypes": "old=x,new=x"
        }
    ],
    "notification": "Query executed in 0.024 sec. Returned 1 record(s)"
}
So it does move the vertex or record, but it creates a new @RID for it.
Reply all
Reply to author
Forward
0 new messages