Database Methods
Returns the view with the given name or null if no such view exists.
Show execution results
- [ArangoView 87577, "example" (type arangosearch)]
- [ArangoView 87577, "example" (type arangosearch)]
Hide execution results
db._view(view-identifier)
Returns the view with the given identifier or null if no such view exists.Accessing views by identifier is discouraged for end users. End users shouldaccess views using the view name.
Examples
Get a view by name:
- arangosh> db._view("demoView");
Show execution results
- [ArangoView 107, "demoView" (type arangosearch)]
Hide execution results
Unknown view:
- null
Hide execution results
Creates a new view named view-name of type view-type with propertiesview-properties.
view-name is a string and the name of the view. No view or collection with thesame name may already exist in the current database. For more information onvalid view names please refer to thenaming conventions.
view-type must be the string "arangosearch"
, as it is currently the onlysupported view type.
view-properties is an optional object containing view configuration specificto each view-type. Currently, only ArangoSearch Views are supported. Seefor details.
Examples
- arangosh> v = db._createView("example", "arangosearch");
- arangosh> v.properties()
Show execution results
- [ArangoView 87567, "example" (type arangosearch)]
- {
- "writebufferSizeMax" : 33554432,
- "consolidationPolicy" : {
- "type" : "bytes_accum",
- "threshold" : 0.10000000149011612
- },
- "writebufferActive" : 0,
- "consolidationIntervalMsec" : 60000,
- "cleanupIntervalStep" : 10,
- "links" : {
- "writebufferIdle" : 64
- }
Hide execution results
Examples
List all views:
Show execution results
- [
- [ArangoView 107, "demoView" (type arangosearch)],
- [ArangoView 87581, "exampleView" (type arangosearch)]
- ]
Hide execution results
db._dropView(view-name)
Drops a view named view-name and all its data. No error is thrown if there isno such view.
Drops a view identified by view-identifier with all its data. No error isthrown if there is no such view.
Examples
Drop a view:
- arangosh> db._createView("exampleView", "arangosearch");
- arangosh> db._dropView("exampleView");
- arangosh> db._view("exampleView");
- [ArangoView 87573, "exampleView" (type arangosearch)]
- null
Hide execution results