forked from orientechnologies/orientdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Console Command Create Property
lvca edited this page Dec 22, 2012
·
3 revisions
The SQL Create Property command creates a new property in the schema. You need to create the class before.
{{{CREATE PROPERTY . [Where:
- class is the class of the schema
- property, is the property created into the class
- type, the type of the property. See 3d11e4af2d6dd98c88aa01bf659bdb85. It can be:
- boolean
- integer
- short
- long
- float
- double
- date
- string
- binary
- embedded
- embeddedlist, this is a container and needs the parameter linked-type or linked-class
- embeddedset, this is a container and needs the parameter linked-type or linked-class
- embeddedmap, this is a container and needs the parameter linked-type or linked-class
- link
- linklist, this is a container and needs the parameter linked-type or linked-class
- linkset, this is a container and needs the parameter linked-type or linked-class
- linkmap, this is a container and needs the parameter linked-type or linked-class
- byte
- linked-type, the contained type in containers (see above). See 3d11e4af2d6dd98c88aa01bf659bdb85. It can be:
- boolean
- integer
- short
- long
- float
- double
- date
- string
- binary
- embedded
- link
- byte
- linked-class, the contained class in containers (see above).
Create the property 'name' of type 'STRING' in class 'User':
CREATE PROPERTY user.name STRING
Create a list of Strings as property 'tags' of type 'EMBEDDEDLIST' in class 'Profile'. The linked type is 'STRING':
CREATE PROPERTY profile.tags EMBEDDEDLIST STRING
Create the property 'friends' of type 'EMBEDDEDMAP' in class 'Profile'. The linked class is profile itself (circular references):
CREATE PROPERTY profile.friends EMBEDDEDMAP Profile
To remove a property use the [SQLRemoveProperty Remove Property](|]}}}) command.
To know more about other SQL commands look at SQL commands.
This is a command of the Orient console. To know all the commands go to Console-Commands.