Orientdb 简明教程

OrientDB - Drop Property

Drop property 命令从模式中删除属性。它不会从记录中删除属性值,只会更改模式。

The Drop property command removes the property from the schema. It does not remove the property values from the record, it just change the schema.

以下语句是 Drop Property 命令的基本语法。

The following statement is the basic syntax of Drop Property Command.

DROP PROPERTY <class>.<property> [FORCE]

以下是上文中选项的详细信息。

Following are the details about the options in the above syntax.

<class> - 定义属性所在类。

<class> − Defines the class where the property exists.

<property> - 定义要删除的属性。

<property> − Defines the property you want to remove.

[Force] - 如果在属性上定义了一个或多个索引。

[Force] − In case one or more indexes are defined on the property.

Example

尝试以下命令从类“Customer”中删除“age”属性。

Try the following command to remove ‘age’ property from the class ‘Customer’.

orientdb> DROP PROPERTY Customer.age

如果上述命令执行成功,您将获得以下输出内容。

If the above command is executed successfully, you will get the following output.

Property dropped successfully