mirror of https://gitee.com/bigwinds/arangodb
57 lines
1.1 KiB
Markdown
57 lines
1.1 KiB
Markdown
<!-- don't edit here, its from https://@github.com/arangodb/arangodbjs.git / docs/Drivers/ -->
|
|
# Accessing views
|
|
|
|
These functions implement the
|
|
[HTTP API for accessing views](../../../..//HTTP/Views/Getting.html).
|
|
|
|
## database.arangoSearchView
|
|
|
|
`database.arangoSearchView(viewName): ArangoSearchView`
|
|
|
|
Returns a _ArangoSearchView_ instance for the given view name.
|
|
|
|
**Arguments**
|
|
|
|
- **viewName**: `string`
|
|
|
|
Name of the arangosearch view.
|
|
|
|
**Examples**
|
|
|
|
```js
|
|
const db = new Database();
|
|
const view = db.arangoSearchView("potatoes");
|
|
```
|
|
|
|
## database.listViews
|
|
|
|
`async database.listViews(): Array<Object>`
|
|
|
|
Fetches all views from the database and returns an array of view
|
|
descriptions.
|
|
|
|
**Examples**
|
|
|
|
```js
|
|
const db = new Database();
|
|
|
|
const views = await db.listViews();
|
|
// views is an array of view descriptions
|
|
```
|
|
|
|
## database.views
|
|
|
|
`async database.views([excludeSystem]): Array<View>`
|
|
|
|
Fetches all views from the database and returns an array of
|
|
_ArangoSearchView_ instances for the views.
|
|
|
|
**Examples**
|
|
|
|
```js
|
|
const db = new Database();
|
|
|
|
const views = await db.views()
|
|
// views is an array of ArangoSearchView instances
|
|
```
|