Deleting Views

Views, just as collections, can be removed from a database. View removal is achieved via an API common to all view types, as follows:

Drops a view

drops a view

DELETE /_api/view/{view-name}

Path Parameters

  • view-name (required): The name of the view to drop.

Drops the view identified by view-name.

If the view was successfully dropped, an object is returned with the following attributes:

  • error: false
  • id: The identifier of the dropped view

Return Codes

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

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

Examples

Using an identifier:

shell> curl -X DELETE --header 'accept: application/json' --dump - http://localhost:8529/_api/view/107906

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

Show response body

Using a name:

shell> curl -X DELETE --header 'accept: application/json' --dump - http://localhost:8529/_api/view/testView

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

Show response body