Database Methods

    Returns the view with the given name or null if no such view exists.

    Show execution results

    Hide execution results

    1. [ArangoView 88709, "example" (type arangosearch)]
    2. [ArangoView 88709, "example" (type arangosearch)]

    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:

    1. arangosh> db._view("demoView");

    Show execution results

    Hide execution results

    1. [ArangoView 99, "demoView" (type arangosearch)]

    Unknown View:

    Hide execution results

    1. null

    Creates a new 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 the .

    type must be the string "arangosearch", as it is currently the onlysupported View type.

    properties is an optional object containing View configuration specificto each View-type. Currently, only ArangoSearch Views are supported. SeeArangoSearch View definition fordetails.

    Examples

    1. arangosh> v = db._createView("example", "arangosearch");
    2. arangosh> v.properties()
    3. arangosh> db._dropView("example")

    Show execution results

    Hide execution results

    1. [ArangoView 88701, "example" (type arangosearch)]
    2. "writebufferIdle" : 64,
    3. "writebufferSizeMax" : 33554432,
    4. "consolidationPolicy" : {
    5. "type" : "tier",
    6. "segmentsBytesFloor" : 2097152,
    7. "segmentsBytesMax" : 5368709120,
    8. "segmentsMax" : 10,
    9. "segmentsMin" : 1,
    10. "minScore" : 0
    11. },
    12. "primarySort" : [ ],
    13. "writebufferActive" : 0,
    14. "consolidationIntervalMsec" : 10000,
    15. "commitIntervalMsec" : 1000,
    16. "links" : {
    17. }
    18. }

    Examples

    List all views:

    Show execution results

    Hide execution results

    1. [
    2. [ArangoView 99, "demoView" (type arangosearch)],
    3. [ArangoView 88712, "exampleView" (type arangosearch)]
    4. ]

    db._dropView(name)

    Drops a view named 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:

    1. arangosh> db._createView("exampleView", "arangosearch");
    2. arangosh> db._dropView("exampleView");
    3. arangosh> db._view("exampleView");

    Hide execution results

    1. [ArangoView 88706, "exampleView" (type arangosearch)]
    2. null