Class: Client

clerk. Client

new Client(uri, authopt)

Clerk CouchDB client.

Parameters:
Name Type Attributes Description
uri String

Fully qualified URI.

auth String <optional>

Authentication header value.

Source:
See:

Methods

config(keyopt, valueopt, queryopt, headersopt, callbackopt) → {Promise}

Get or set configuration values.

Parameters:
Name Type Attributes Description
key String <optional>

Configuration section or key.

value String <optional>

Configuration value.

query Object <optional>

HTTP query options.

headers Object <optional>

HTTP headers.

callback handler <optional>

Callback function.

Source:
Returns:

A Promise, if no callback is provided, otherwise null.

Type
Promise

db(name) → {DB}

Select database to manipulate.

Parameters:
Name Type Description
name String

DB name.

Source:
Returns:

DB object.

Type
DB

dbs(queryopt, headersopt, callbackopt) → {Promise}

List all databases.

Parameters:
Name Type Attributes Description
query Object <optional>

HTTP query options.

headers Object <optional>

HTTP headers.

callback handler <optional>

Callback function.

Source:
See:
Returns:

A Promise, if no callback is provided, otherwise null.

Type
Promise

info(queryopt, headersopt, callbackopt) → {Promise}

Get server information.

Parameters:
Name Type Attributes Description
query Object <optional>

HTTP query options.

headers Object <optional>

HTTP headers.

callback handler <optional>

Callback function.

Source:
See:
Returns:

A Promise, if no callback is provided, otherwise null.

Type
Promise

log(queryopt, headersopt, callbackopt) → {Promise}

Get tail of the server log file.

Parameters:
Name Type Attributes Description
query Object <optional>

Query parameters.

Properties
Name Type Attributes Description
bytes Integer <optional>

Number of bytes to read.

offset Integer <optional>

Number of bytes from the end of log file to start reading.

headers Object <optional>

HTTP headers.

callback handler <optional>

Callback function.

Source:
See:
Returns:

A Promise, if no callback is provided, otherwise null.

Type
Promise

replicate(options, queryopt, headersopt, callbackopt) → {Promise}

Replicate databases.

Parameters:
Name Type Attributes Description
options Object

Options.

Properties
Name Type Attributes Description
source String

Source database URL or local name.

target String

Target database URL or local name.

cancel Boolean <optional>

Set to true to cancel replication.

continuous Boolean <optional>

Set to true for continuous replication.

create_target Boolean <optional>

Set to true to create the target database.

filter String <optional>

Filter name for filtered replication. Example: "mydesign/myfilter".

query Object <optional>

Query parameters for filter.

doc_ids Array.<String> <optional>

Document IDs to replicate.

proxy String <optional>

Proxy through which to replicate.

query Object <optional>

HTTP query options.

headers Object <optional>

HTTP headers.

callback handler <optional>

Callback function.

Source:
See:
Returns:

A Promise, if no callback is provided, otherwise null.

Type
Promise

stats(queryopt, headersopt, callbackopt) → {Promise}

Get server stats.

Parameters:
Name Type Attributes Description
query Object <optional>

HTTP query options.

headers Object <optional>

HTTP headers.

callback handler <optional>

Callback function.

Source:
See:
Returns:

A Promise, if no callback is provided, otherwise null.

Type
Promise

tasks(queryopt, headersopt, callbackopt) → {Promise}

List running tasks.

Parameters:
Name Type Attributes Description
query Object <optional>

HTTP query options.

headers Object <optional>

HTTP headers.

callback handler <optional>

Callback function.

Source:
See:
Returns:

A Promise, if no callback is provided, otherwise null.

Type
Promise

uuids(countopt, queryopt, headersopt, callbackopt) → {Promise}

Get UUIDs.

Parameters:
Name Type Attributes Default Description
count Integer <optional>
1

Number of UUIDs to get.

query Object <optional>

HTTP query options.

headers Object <optional>

HTTP headers.

callback handler <optional>

Callback function.

Source:
See:
Returns:

A Promise, if no callback is provided, otherwise null.

Type
Promise