OrientDB data set isn't just a Document information base yet in addition a Graph data set. New ideas, for example, Vertex and Edge are utilized to store the information as chart. It applies polymorphism on vertices. The base class for Vertex is V.
In this section you can figure out how to make vertex to store diagram information.
The accompanying assertion is the essential grammar of Create Vertex Command.
CREATE VERTEX [<class>] [CLUSTER <cluster>] [SET <field> = <expression>[,]*]
Following are the insights regarding the choices in the above grammar.
- <class> − Defines the class to which the vertex has a place.
- <cluster> − Defines the group where it stores the vertex.
- <field> − Defines the field you need to set.
- <expression> − Defines the express to set for the field.
Example
Attempt the accompanying guide to see how to make vertex.
Execute the accompanying question to make a vertex without 'name' and on the base class V.
orientdb> CREATE VERTEX
In the event that the above question is executed effectively, you will get the accompanying yield.
Created vertex 'V#9:0 v1' in 0.118000 sec(s)
Execute the accompanying inquiry to make another vertex class named v1, at that point make vertex in that class.
orientdb> CREATE CLASS V1 EXTENDS V
orientdb> CREATE VERTEX V1
In the event that the above question is executed effectively, you will get the accompanying yield.
Created vertex 'V1#14:0 v1' in 0.004000 sec(s)
Execute the accompanying inquiry to make another vertex of the class named v1, characterizing its properties, for example, brand = 'Maruti' and name = 'Quick'.
orientdb> CREATE VERTEX V1 SET brand = 'maruti', name = 'swift'
On the off chance that the above inquiry is executed effectively, you will get the accompanying yield.
Created vertex 'V1#14:1{brand:maruti,name:swift} v1' in 0.004000 sec(s)