1
0
Fork 0
arangodb/Documentation/Books/Manual/DataModeling/Views/ViewMethods.md

2.5 KiB

View Methods

Drop

view.drop()

Drops a view and all its data.

Examples

Drop a view:

arangosh> db._createView("example", \<view-type\>, \<view-properties\>);
arangosh> v = db._view("example");
arangosh> v.drop();
arangosh> v;

Query Name

view.name()

Returns the name of the view.

Examples

Get view name:

arangosh> db._createView("example", \<view-type\>, \<view-properties\>);
arangosh> v = db._view("example");
arangosh> v.name();
arangosh> db._dropView("example");

Modify Name

view.rename(new-name)

Renames a view using the new-name. The new-name must not already be used by a different view. new-name must also be a valid view name. For more information on valid view names please refer to the naming conventions.

If renaming fails for any reason, an error is thrown.

Examples

arangosh> db._createView("example", \<view-type\>, \<view-properties\>);
arangosh> v = db._view("example");
arangosh> v.name();
arangosh> v.rename("example-renamed");
arangosh> v.name();
arangosh> db._dropView("example-renamed");

Query Type

view.type()

Returns the type of the view.

Examples

Get view type:

arangosh> db._createView("example", \<view-type\>, \<view-properties\>);
arangosh> v = db._view("example");
arangosh> v.type();
arangosh> db._dropView("example");

Query Properties

view.properties()

Returns the properties of the view. The format of the result is specific to each of the supported View Types.

Examples

Get view properties:

arangosh> db._createView("example", \<view-type\>, \<view-properties\>);
arangosh> v = db._view("example");
arangosh> v.properties();
arangosh> db._dropView("example");

Modify Properties

view.properties(view-property-modification)

Modifies the properties of the view. The format of the result is specific to each of the supported View Types.

Examples

Modify view properties:

arangosh> db._createView("example", \<view-type\>, \<view-properties\>);
arangosh> v = db._view("example");
arangosh> v.properties(\<view-property-modification\>);
arangosh> db._dropView("example");