Move Vertex order in OrientDB is to move at least one vertices from current area to various class or bunch. In the event that you are applying move order on a specific vertex, at that point it will refresh all the edges that are associated with this vertex. On the off chance that you are determining a group to move vertex, at that point it moves the vertices to the worker proprietor of the objective bunch.
The accompanying assertion is the fundamental grammar of Move Vertex Command.
MOVE VERTEX <source> TO <destination>
[SET [<field>=<value>]* [,]]
[MERGE <JSON>]
[BATCH <batch-size>]
Following are the insights concerning the alternatives in the above sentence structure.
- <source> − Defines the vertex you need to move. It acknowledges Record ID of a specific vertex or cluster of Record IDs for vertices.
- <destination> − Defines where you need to move the vertex. It bolsters either class or a bunch as objective.
- SET − Sets the qualities to fields.
- Consolidation − Sets the qualities to fields through JSON.
- Cluster − Defines the clump size.
Note − This order refreshes every single associated edge, however not connections. When utilizing Graph API, it is prescribed to utilize edge associated with vertices.
Example
Attempt the accompanying guides to figure out how to move vertices.
Execute the accompanying question to move a solitary vertex having Record ID #11:2 from its present situation to Class Employee.
orientdb> MOVE VERTEX #11:2 TO CLASS:Employee
On the off chance that the above inquiry is executed effectively, you will get the accompanying yield −
Move vertex command executed with result '[{old:#11:2, new:#13:0}]' in 0.022000 sec(s)
Execute the accompanying inquiry to move set of vertices from the class 'Client' to class 'Worker'.
orientdb> MOVE VERTEX (SELECT FROM Customer) TO CLASS:Employee
In the event that the above inquiry is executed effectively, you will get the accompanying yield.
Move vertex command executed with result '[{old:#11:0,
new:#13:1},{old:#11:1, new:#13:2},{old:#11:2, new:#13:3}]' in 0.011000 sec(s)