View Methods

Drop

view.drop()

Drops a View and all its data.

Examples

Drop a View:

  1. arangosh> v = db._createView("example", "arangosearch");
  2. ........> // or
  3. arangosh> v = db._view("example");
  4. arangosh> v.drop();
  5. arangosh> db._view("example");

Show execution results

  1. [ArangoView 88620, "example" (type arangosearch)]
  2. [ArangoView 88620, "example" (type arangosearch)]
  3. null

Hide execution results

Query Name

view.name()

Returns the name of the View.

Examples

Get View name:

  1. arangosh> v = db._view("demoView");
  2. arangosh> v.name();

Show execution results

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

Hide execution results

Rename

view.rename(new-name)

Renames a view using the new-name. The new-name must not already be used bya different view or collection in the same database. new-name must also be avalid view name. For more information on valid view names please refer to thenaming conventions.

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

The rename method is not available in clusters.

Examples

  1. arangosh> v = db._createView("example", "arangosearch");
  2. arangosh> v.name();
  3. arangosh> v.rename("exampleRenamed");
  4. arangosh> v.name();

Show execution results

  1. [ArangoView 88642, "example" (type arangosearch)]
  2. example
  3. exampleRenamed

Hide execution results

Query Type

view.type()

Returns the type of the View.

Examples

Get View type:

  1. arangosh> v = db._view("demoView");
  2. arangosh> v.type();

Show execution results

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

Hide execution results

Query Properties

view.properties()

Returns the properties of the View. The format of the result is specific toeach of the supported View Types.

Examples

Get View properties:

  1. arangosh> v = db._view("demoView");
  2. arangosh> v.properties();

Show execution results

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

Hide execution results

Modify Properties

view.properties(new-properties, partialUpdate)

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

partialUpdate is an optional Boolean parameter (true by default) thatdetermines how the new-properties object is merged with current View properties(adds or updates new-properties properties to current if true replaces allproperties if false).

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

Examples

Modify View properties:

  1. arangosh> v = db._view("example");
  2. arangosh> v.properties();
  3. ........> // set cleanupIntervalStep to 12
  4. arangosh> v.properties({cleanupIntervalStep: 12});
  5. ........> // add a link
  6. arangosh> v.properties({links: {demo: {}}})
  7. ........> // remove a link
  8. arangosh> v.properties({links: {demo: null}})

Show execution results

  1. [ArangoView 88626, "example" (type arangosearch)]
  2. {
  3. "writebufferIdle" : 64,
  4. "writebufferActive" : 0,
  5. "primarySort" : [ ],
  6. "writebufferSizeMax" : 33554432,
  7. "commitIntervalMsec" : 1000,
  8. "consolidationPolicy" : {
  9. "type" : "tier",
  10. "segmentsBytesFloor" : 2097152,
  11. "segmentsBytesMax" : 5368709120,
  12. "segmentsMax" : 10,
  13. "segmentsMin" : 1,
  14. "minScore" : 0
  15. },
  16. "cleanupIntervalStep" : 2,
  17. "links" : {
  18. },
  19. "consolidationIntervalMsec" : 10000
  20. }
  21. {
  22. "cleanupIntervalStep" : 12,
  23. "commitIntervalMsec" : 1000,
  24. "consolidationIntervalMsec" : 10000,
  25. "consolidationPolicy" : {
  26. "type" : "tier",
  27. "segmentsBytesFloor" : 2097152,
  28. "segmentsBytesMax" : 5368709120,
  29. "segmentsMax" : 10,
  30. "segmentsMin" : 1,
  31. "minScore" : 0
  32. },
  33. "primarySort" : [ ],
  34. "writebufferActive" : 0,
  35. "writebufferIdle" : 64,
  36. "writebufferSizeMax" : 33554432,
  37. "links" : {
  38. }
  39. }
  40. {
  41. "cleanupIntervalStep" : 12,
  42. "commitIntervalMsec" : 1000,
  43. "consolidationIntervalMsec" : 10000,
  44. "consolidationPolicy" : {
  45. "type" : "tier",
  46. "segmentsBytesFloor" : 2097152,
  47. "segmentsBytesMax" : 5368709120,
  48. "segmentsMax" : 10,
  49. "segmentsMin" : 1,
  50. "minScore" : 0
  51. },
  52. "primarySort" : [ ],
  53. "writebufferActive" : 0,
  54. "writebufferIdle" : 64,
  55. "writebufferSizeMax" : 33554432,
  56. "links" : {
  57. "demo" : {
  58. "analyzers" : [
  59. "identity"
  60. ],
  61. "fields" : {
  62. },
  63. "includeAllFields" : false,
  64. "storeValues" : "none",
  65. "trackListPositions" : false
  66. }
  67. }
  68. }
  69. {
  70. "cleanupIntervalStep" : 12,
  71. "commitIntervalMsec" : 1000,
  72. "consolidationIntervalMsec" : 10000,
  73. "consolidationPolicy" : {
  74. "type" : "tier",
  75. "segmentsBytesFloor" : 2097152,
  76. "segmentsBytesMax" : 5368709120,
  77. "segmentsMax" : 10,
  78. "segmentsMin" : 1,
  79. "minScore" : 0
  80. },
  81. "primarySort" : [ ],
  82. "writebufferActive" : 0,
  83. "writebufferIdle" : 64,
  84. "writebufferSizeMax" : 33554432,
  85. "links" : {
  86. }
  87. }

Hide execution results