View Methods

DropPermalink

view.drop()

Drops a View and all its data.

Examples

Drop a View:

Permalink
arangosh> v = db._createView("example", "arangosearch");
........> // or
arangosh> v = db._view("example");
arangosh> v.drop();
arangosh> db._view("example");
Show execution results
Hide execution results
[ArangoView 82410, "example" (type arangosearch)]
[ArangoView 82410, "example" (type arangosearch)]
null

Query NamePermalink

view.name()

Returns the name of the View.

Examples

Get View name:

Permalink
arangosh> v = db._view("demoView");
arangosh> v.name();
Show execution results
Hide execution results
[ArangoView 105, "demoView" (type arangosearch)]
demoView

RenamePermalink

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 more information on valid view names please refer to the naming conventions.

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

The rename method is not available in clusters.

Examples

Permalink
arangosh> v = db._createView("example", "arangosearch");
arangosh> v.name();
arangosh> v.rename("exampleRenamed");
arangosh> v.name();
Show execution results
Hide execution results
[ArangoView 82436, "example" (type arangosearch)]
example
exampleRenamed

Query TypePermalink

view.type()

Returns the type of the View.

Examples

Get View type:

Permalink
arangosh> v = db._view("demoView");
arangosh> v.type();
Show execution results
Hide execution results
[ArangoView 105, "demoView" (type arangosearch)]
arangosearch

Query PropertiesPermalink

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:

Permalink
arangosh> v = db._view("demoView");
arangosh> v.properties();
Show execution results
Hide execution results
[ArangoView 105, "demoView" (type arangosearch)]
{ 
  "writebufferSizeMax" : 33554432, 
  "writebufferIdle" : 64, 
  "consolidationIntervalMsec" : 1000, 
  "consolidationPolicy" : { 
    "type" : "tier", 
    "segmentsBytesFloor" : 2097152, 
    "segmentsBytesMax" : 5368709120, 
    "segmentsMax" : 10, 
    "segmentsMin" : 1, 
    "minScore" : 0 
  }, 
  "writebufferActive" : 0, 
  "commitIntervalMsec" : 1000, 
  "links" : { 
  }, 
  "storedValues" : [ ], 
  "cleanupIntervalStep" : 2, 
  "primarySort" : [ ], 
  "primarySortCompression" : "lz4" 
}

Modify PropertiesPermalink

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).

Currently, the only supported View type is "arangosearch". See ArangoSearch View Properties.

Examples

Modify View properties:

Permalink
arangosh> v = db._view("example");
arangosh> v.properties();
........> // set cleanupIntervalStep to 12
arangosh> v.properties({cleanupIntervalStep: 12});
........> // add a link
arangosh> v.properties({links: {demo: {}}})
........> // remove a link
arangosh> v.properties({links: {demo: null}})
Show execution results
Hide execution results
[ArangoView 82417, "example" (type arangosearch)]
{ 
  "writebufferSizeMax" : 33554432, 
  "writebufferIdle" : 64, 
  "consolidationIntervalMsec" : 1000, 
  "consolidationPolicy" : { 
    "type" : "tier", 
    "segmentsBytesFloor" : 2097152, 
    "segmentsBytesMax" : 5368709120, 
    "segmentsMax" : 10, 
    "segmentsMin" : 1, 
    "minScore" : 0 
  }, 
  "writebufferActive" : 0, 
  "commitIntervalMsec" : 1000, 
  "links" : { 
  }, 
  "storedValues" : [ ], 
  "cleanupIntervalStep" : 2, 
  "primarySort" : [ ], 
  "primarySortCompression" : "lz4" 
}
{ 
  "cleanupIntervalStep" : 12, 
  "commitIntervalMsec" : 1000, 
  "consolidationIntervalMsec" : 1000, 
  "consolidationPolicy" : { 
    "type" : "tier", 
    "segmentsBytesFloor" : 2097152, 
    "segmentsBytesMax" : 5368709120, 
    "segmentsMax" : 10, 
    "segmentsMin" : 1, 
    "minScore" : 0 
  }, 
  "primarySort" : [ ], 
  "primarySortCompression" : "lz4", 
  "storedValues" : [ ], 
  "writebufferActive" : 0, 
  "writebufferIdle" : 64, 
  "writebufferSizeMax" : 33554432, 
  "links" : { 
  } 
}
{ 
  "cleanupIntervalStep" : 12, 
  "commitIntervalMsec" : 1000, 
  "consolidationIntervalMsec" : 1000, 
  "consolidationPolicy" : { 
    "type" : "tier", 
    "segmentsBytesFloor" : 2097152, 
    "segmentsBytesMax" : 5368709120, 
    "segmentsMax" : 10, 
    "segmentsMin" : 1, 
    "minScore" : 0 
  }, 
  "primarySort" : [ ], 
  "primarySortCompression" : "lz4", 
  "storedValues" : [ ], 
  "writebufferActive" : 0, 
  "writebufferIdle" : 64, 
  "writebufferSizeMax" : 33554432, 
  "links" : { 
    "demo" : { 
      "analyzers" : [ 
        "identity" 
      ], 
      "fields" : { 
      }, 
      "includeAllFields" : false, 
      "storeValues" : "none", 
      "trackListPositions" : false 
    } 
  } 
}
{ 
  "cleanupIntervalStep" : 12, 
  "commitIntervalMsec" : 1000, 
  "consolidationIntervalMsec" : 1000, 
  "consolidationPolicy" : { 
    "type" : "tier", 
    "segmentsBytesFloor" : 2097152, 
    "segmentsBytesMax" : 5368709120, 
    "segmentsMax" : 10, 
    "segmentsMin" : 1, 
    "minScore" : 0 
  }, 
  "primarySort" : [ ], 
  "primarySortCompression" : "lz4", 
  "storedValues" : [ ], 
  "writebufferActive" : 0, 
  "writebufferIdle" : 64, 
  "writebufferSizeMax" : 33554432, 
  "links" : { 
  } 
}