Property in OrientDB works like a field of class and segment in the data set table. Make Property is an order used to make a property for a specific class. The class name that you utilized in the order should exist.
The accompanying assertion is the essential language structure of Create Property order.
CREATE PROPERTY <class-name>.<property-name> <property-type> [<linked-type>][ <linked-class>]
Following are the insights concerning the choices in the above sentence structure.
- <class-name> − Defines the class you need to make the property in.
- <property-name> − Defines the sensible name of the property.
- <property-type> − Defines the kind of property you need to make.
- <linked-type> − Defines the holder type, utilized in compartment property type.
- <linked-class> − Defines the holder class, utilized in compartment property type.
The accompanying table gives the information type to property so OrientDB knows the kind of information to store.
BOOLEAN | INTEGER | SHORT | LONG |
FLOAT | DATE | STRING | EMBEDDED |
LINK | BYTE | BINARY | DOUBLE |
Notwithstanding these there are a few other property types that fill in as compartments.
EMBEDDEDLIST | EMBEDDEDSET | EMBEDDEDMAP |
LINKLIST | LINKSET | LINKMAP |
Example
Attempt the accompanying guide to make a property name on the class Employee, of the String type.
orientdb> CREATE PROPERTY Employee.name STRING
On the off chance that the above question is executed effectively, you will get the accompanying yield.
Property created successfully with id = 1