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. |
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. |
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
|
||||||||||||
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
|
|||||||||||||||||||||||||||||||||||||||||
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