OrientDB Manual 1.7.8

SQL - CREATE VERTEX

This command creates a new Vertex into the database. Vertices, together with Edges, are the main components of a Graph. OrientDB supports polymorphism on vertices. The base class is "V" (before 1.4 was called "OGraphVertex"). Look also how to Create Edges.

Syntax

CREATE VERTEX [<class>] [CLUSTER <cluster>] [SET <field> = <expression>[,]*]

History and Compatibility

  • 1.1: first version
  • starting from v.1.4 the command uses the Blueprints API under the hood, so if you're working in Java using the OGraphDatabase API you could experience in some difference how edges are managed. To force the command to work with the "old" API change the GraphDB settings described in Graph backward compatibility

Examples

Create a new vertex of the base class 'V', namely OGraphVertex

create vertex

Create a new vertex type and a new vertex of the new type

create class V1 extends V
create vertex V1

Create a new vertex in a particular cluster

create vertex V1 cluster recent

Create a new vertex setting properties

create vertex set brand = 'fiat'

Create a new vertex of type V1 setting properties

create vertex V1 set brand = 'fiat', name = 'wow'

Create a vertex with JSON content

create vertex Employee content { "name" : "Jay", "surname" : "Miner" }

To know more about other SQL commands look at SQL commands.