View Methods
Drop
view.drop()
Drops a View and all its data.
Examples
Drop a View:
arangosh> v = db._createView("example", "arangosearch");
........> // or
arangosh> v = db._view("example");
arangosh> v.drop();
arangosh> db._view("example");
[ArangoView 84751, "example" (type arangosearch)]
[ArangoView 84751, "example" (type arangosearch)]
null
Query Name
view.name()
Returns the name of the View.
Examples
Get View name:
arangosh> v = db._view("demoView");
arangosh> v.name();
[ArangoView 99, "demoView" (type arangosearch)]
demoView
Rename
view.rename(new-name)
Renames a view using the new-name
. The new-name
must not already be used by
a different view or collection in the same database. new-name
must also be a
valid view name. For information about the naming constraints for Views, see
View names.
If renaming fails for any reason, an error is thrown.
The rename method is not available in clusters.
Examples
arangosh> v = db._createView("example", "arangosearch");
arangosh> v.name();
arangosh> v.rename("exampleRenamed");
arangosh> v.name();
[ArangoView 84794, "example" (type arangosearch)]
example
exampleRenamed
Query Type
view.type()
Returns the type of the View.
Examples
Get View type:
arangosh> v = db._view("demoView");
arangosh> v.type();
[ArangoView 99, "demoView" (type arangosearch)]
arangosearch
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:
Modify Properties
view.properties(new-properties, partialUpdate)
Modifies the properties of the view
. The format of the result is specific to
each of the supported View Types.
partialUpdate
is an optional Boolean parameter (true
by default) that
determines how the new-properties
object is merged with current View properties
(adds or updates new-properties
properties to current if true
replaces all
properties if false
).
For the available properties of the supported View types, see:
Examples
Modify arangosearch
View properties:
Add and remove inverted indexes from a search-alias
View: