Arangox.API.Views (Arangox v0.8.0)

Copy Markdown View Source

ArangoDB's Views operations.

Every function takes the pool as its first argument and returns the decoded response body. See Arangox.API.Client for the options they all accept and for what a 404 returns.

Summary

Functions

List all Views

List all Views. Raises on error.

Create an arangosearch View

Create an arangosearch View. Raises on error.

Drop a View. Raises on error.

Get information about a View

Get information about a View. Raises on error.

Get the properties of a View

Get the properties of a View. Raises on error.

Rename a View. Raises on error.

Replace the properties of an arangosearch View

Replace the properties of an arangosearch View. Raises on error.

Update the properties of an arangosearch View

Update the properties of an arangosearch View. Raises on error.

Functions

all(conn, opts \\ [])

@spec all(
  Arangox.conn(),
  keyword()
) :: {:ok, term()} | {:error, Exception.t()}

List all Views

Returns an object containing a listing of all Views in the current database, regardless of their type.

Returns

Recorded against ArangoDB 3.12.10:

%{
  "code" => integer,
  "error" => boolean,
  "result" => [%{
    "globallyUniqueId" => string,
    "id" => string,
    "name" => string,
    "type" => string
  }]
}

all!(conn, opts \\ [])

@spec all!(
  Arangox.conn(),
  keyword()
) :: term()

List all Views. Raises on error.

See all/1.

create(conn, body, opts \\ [])

@spec create(Arangox.conn(), term(), keyword()) ::
  {:ok, term()} | {:error, Exception.t()}

Create an arangosearch View

Creates a new View with a given name and properties if it does not already exist.

create!(conn, body, opts \\ [])

@spec create!(Arangox.conn(), term(), keyword()) :: term()

Create an arangosearch View. Raises on error.

See create/2.

delete(conn, view_name, opts \\ [])

@spec delete(Arangox.conn(), binary(), keyword()) ::
  {:ok, term()} | {:error, Exception.t()}

Drop a View

Deletes the View identified by view-name.

delete!(conn, view_name, opts \\ [])

@spec delete!(Arangox.conn(), binary(), keyword()) :: term()

Drop a View. Raises on error.

See delete/2.

get(conn, view_name, opts \\ [])

@spec get(Arangox.conn(), binary(), keyword()) ::
  {:ok, term()} | {:error, Exception.t()}

Get information about a View

Returns the basic information about a specific View.

Returns

Recorded against ArangoDB 3.12.10:

%{
  "code" => integer,
  "error" => boolean,
  "globallyUniqueId" => string,
  "id" => string,
  "name" => string,
  "type" => string
}

get!(conn, view_name, opts \\ [])

@spec get!(Arangox.conn(), binary(), keyword()) :: term()

Get information about a View. Raises on error.

See get/2.

properties(conn, view_name, opts \\ [])

@spec properties(Arangox.conn(), binary(), keyword()) ::
  {:ok, term()} | {:error, Exception.t()}

Get the properties of a View

Returns an object containing the definition of the View identified by view-name.

Returns

Recorded against ArangoDB 3.12.10:

%{
  "cleanupIntervalStep" => integer,
  "code" => integer,
  "commitIntervalMsec" => integer,
  "consolidationIntervalMsec" => integer,
  "consolidationPolicy" => %{
    "maxSkewThreshold" => float,
    "minDeletionRatio" => float,
    "segmentsBytesMax" => integer,
    "type" => string
  },
  "error" => boolean,
  "globallyUniqueId" => string,
  "id" => string,
  "links" => %{},
  "name" => string,
  "optimizeTopK" => [],
  "primarySort" => [],
  "primarySortCompression" => string,
  "storedValues" => [],
  "type" => string,
  "writebufferActive" => integer,
  "writebufferIdle" => integer,
  "writebufferSizeMax" => integer
}

properties!(conn, view_name, opts \\ [])

@spec properties!(Arangox.conn(), binary(), keyword()) :: term()

Get the properties of a View. Raises on error.

See properties/2.

rename(conn, view_name, body, opts \\ [])

@spec rename(Arangox.conn(), binary(), term(), keyword()) ::
  {:ok, term()} | {:error, Exception.t()}

Rename a View

Renames a View.

INFO: Renaming Views is not supported in cluster deployments.

rename!(conn, view_name, body, opts \\ [])

@spec rename!(Arangox.conn(), binary(), term(), keyword()) :: term()

Rename a View. Raises on error.

See rename/3.

replace_properties(conn, view_name, body, opts \\ [])

@spec replace_properties(Arangox.conn(), binary(), term(), keyword()) ::
  {:ok, term()} | {:error, Exception.t()}

Replace the properties of an arangosearch View

Changes all properties of a View by replacing them, except for immutable properties.

replace_properties!(conn, view_name, body, opts \\ [])

@spec replace_properties!(Arangox.conn(), binary(), term(), keyword()) :: term()

Replace the properties of an arangosearch View. Raises on error.

See replace_properties/3.

update_properties(conn, view_name, body, opts \\ [])

@spec update_properties(Arangox.conn(), binary(), term(), keyword()) ::
  {:ok, term()} | {:error, Exception.t()}

Update the properties of an arangosearch View

Partially changes the properties of a View by updating the specified attributes.

update_properties!(conn, view_name, body, opts \\ [])

@spec update_properties!(Arangox.conn(), binary(), term(), keyword()) :: term()

Update the properties of an arangosearch View. Raises on error.

See update_properties/3.