CouchDB.LocalDocs (couchdb_auth v0.2.4)

View Source

Helpers for interacting with CouchDB local (_local) documents.

Local documents are stored per node and never replicate. These helpers generate the correct request paths and delegate to the main CouchDB HTTP client.

Summary

Functions

Deletes a local document.

Fetches a local document.

Returns the request path for a local document.

Creates or updates a local document with the provided body.

Types

doc_id()

@type doc_id() :: String.t() | atom()

Functions

delete(doc_id, opts \\ [])

@spec delete(
  doc_id(),
  keyword()
) :: {:ok, Tesla.Env.t()} | {:error, any()}

Deletes a local document.

get(doc_id, opts \\ [])

@spec get(
  doc_id(),
  keyword()
) :: {:ok, Tesla.Env.t()} | {:error, any()}

Fetches a local document.

path(doc_id, opts \\ [])

@spec path(
  doc_id(),
  keyword()
) :: String.t()

Returns the request path for a local document.

Accepts an optional :database override; otherwise falls back to the configured database.

put(doc_id, body, opts \\ [])

@spec put(doc_id(), any(), keyword()) :: {:ok, Tesla.Env.t()} | {:error, any()}

Creates or updates a local document with the provided body.