ArangoDB v3.4 reached End of Life (EOL) and is no longer supported.

This documentation is outdated. Please see the most recent version here: Latest Docs

Modifying a View

Renaming a View

Views, just as collections, can be renamed. View rename is achieved via an API common to all view types, as follows:

Rename a view

renames a view

PUT /_api/view/{view-name}/rename

Path Parameters

  • view-name (string, required): The name of the view to rename.

Renames a view. Expects an object with the attribute(s)

  • name: The new name

It returns an object with the attributes

  • id: The identifier of the view.
  • name: The new name of the view.
  • type: The view type.

Note: this method is not available in a cluster.

Responses

HTTP 400: If the view-name is missing, then a HTTP 400 is returned.

HTTP 404: If the view-name is unknown, then a HTTP 404 is returned.

Examples

shell> curl -X PUT --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/view/products1/rename <<EOF
{ 
  "name" : "viewNewName" 
}
EOF

HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff

Show response body

Modifying View Properties

Some view types allow run-time modification of internal properties. Which, if any properties are modifiable is implementation dependant and varies for each supported view type. Please refer to the proper section of the required view type for details.

However, in general the format is the following:

Update of All Possible Properties

All modifiable properties of a view may be set to the specified definition, (i.e. “make the view exactly like this”), via:

Change properties of an ArangoDB view

changes properties of an ArangoDB view

PUT /_api/view/{view-name}/properties

Path Parameters

  • view-name (string, required): The name of the view.

Changes the properties of a view.

On success an object with the following attributes is returned:

  • id: The identifier of the view
  • name: The name of the view
  • type: The view type
  • any additional view implementation specific properties

Responses

HTTP 400: If the view-name is missing, then a HTTP 400 is returned.

HTTP 404: If the view-name is unknown, then a HTTP 404 is returned.

Examples

shell> curl -X PUT --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/view/products/properties <<EOF
{ 
}
EOF

HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff

Show response body

Update of Specific Properties (delta)

Specific modifiable properties of a view may be set to the specified values, (i.e. “change only these properties to the specified values”), via:

Partially changes properties of an ArangoDB view

partially changes properties of an ArangoDB view

PATCH /_api/view/{view-name}/properties

Path Parameters

  • view-name (string, required): The name of the view.

Changes the properties of a view.

On success an object with the following attributes is returned:

  • id: The identifier of the view
  • name: The name of the view
  • type: The view type
  • any additional view implementation specific properties

Responses

HTTP 400: If the view-name is missing, then a HTTP 400 is returned.

HTTP 404: If the view-name is unknown, then a HTTP 404 is returned.

Examples

shell> curl -X PATCH --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/view/products/properties <<EOF
{ 
}
EOF

HTTP/1.1 OK
content-type: application/json; charset=utf-8
x-content-type-options: nosniff

Show response body