View Methods

    Drops a view and all its data.

    Examples

    Drop a view:

    Show execution results

    1. [ArangoView 87589, "example" (type arangosearch)]
    2. [ArangoView 87589, "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 107, "demoView" (type arangosearch)]
    2. demoView

    Hide execution results

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

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

    Note: this method is not available in a cluster.

    Examples

    Show execution results

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

    Hide execution results

    Query 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 107, "demoView" (type arangosearch)]
    2. arangosearch

    view.properties()

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

    Examples

    Get view properties:

    Show execution results

    1. [ArangoView 107, "demoView" (type arangosearch)]
    2. {
    3. "writebufferSizeMax" : 33554432,
    4. "consolidationPolicy" : {
    5. "type" : "bytes_accum",
    6. "threshold" : 0.10000000149011612
    7. },
    8. "writebufferActive" : 0,
    9. "consolidationIntervalMsec" : 60000,
    10. "cleanupIntervalStep" : 10,
    11. "links" : {
    12. },
    13. "writebufferIdle" : 64
    14. }

    Hide execution results

    Modify Properties

    view.properties(view-property-modification, partialUpdate)

    Modifies the properties of the view. The format of the result is specific toeach of the supported . partialUpdate is an optionalboolean parameter ( by default) that determines howview-property-modification is merged with current view properties (adds or updates view-property-modification properties to current if true and, additionally, removes all other properties if false).

    Currently, the only supported view type is , and its propertiescan be found inArangoSearch detailed overview.

    Examples

    Modify view properties:

    1. arangosh> v.properties();
    2. ........> // set cleanupIntervalStep to 12
    3. arangosh> v.properties({cleanupIntervalStep: 12});
    4. ........> // add a link
    5. arangosh> v.properties({links: {demo: {}}})
    6. ........> // remove a link
    7. arangosh> v.properties({links: {demo: null}})
    1. [ArangoView 87596, "example" (type arangosearch)]
    2. {
    3. "writebufferSizeMax" : 33554432,
    4. "consolidationPolicy" : {
    5. "type" : "bytes_accum",
    6. "threshold" : 0.10000000149011612
    7. },
    8. "writebufferActive" : 0,
    9. "consolidationIntervalMsec" : 60000,
    10. "cleanupIntervalStep" : 10,
    11. "links" : {
    12. },
    13. "writebufferIdle" : 64
    14. }
    15. {
    16. "cleanupIntervalStep" : 12,
    17. "consolidationIntervalMsec" : 60000,
    18. "consolidationPolicy" : {
    19. "type" : "bytes_accum",
    20. "threshold" : 0.10000000149011612
    21. },
    22. "writebufferActive" : 0,
    23. "writebufferIdle" : 64,
    24. "writebufferSizeMax" : 33554432,
    25. "links" : {
    26. }
    27. }
    28. "cleanupIntervalStep" : 12,
    29. "consolidationIntervalMsec" : 60000,
    30. "consolidationPolicy" : {
    31. "type" : "bytes_accum",
    32. "threshold" : 0.10000000149011612
    33. },
    34. "writebufferActive" : 0,
    35. "writebufferIdle" : 64,
    36. "writebufferSizeMax" : 33554432,
    37. "links" : {
    38. "demo" : {
    39. "analyzers" : [
    40. "identity"
    41. ],
    42. "fields" : {
    43. },
    44. "includeAllFields" : false,
    45. "storeValues" : "none",
    46. "trackListPositions" : false
    47. }
    48. }
    49. }
    50. {
    51. "cleanupIntervalStep" : 12,
    52. "consolidationIntervalMsec" : 60000,
    53. "consolidationPolicy" : {
    54. "type" : "bytes_accum",
    55. "threshold" : 0.10000000149011612
    56. },
    57. "writebufferActive" : 0,
    58. "writebufferIdle" : 64,
    59. "writebufferSizeMax" : 33554432,
    60. "links" : {
    61. }

    Hide execution results