Class

Cluster

Cluster

Cluster represents an entire Couchbase Server cluster.

Methods

# async static connect(connStr, optionsopt, callbackopt) → {Promise.<Cluster>}

Connect establishes a connection to the cluster and is the entry point for all SDK operations.

Parameters:
Name Type Attributes Description
connStr string
options Object <optional>
username string <optional>
password string <optional>
authenticator string <optional>
trustStorePath string <optional>
kvTimeout number <optional>
kvDurableTimeout number <optional>
viewTimeout number <optional>
queryTimeout number <optional>
analyticsTimeout number <optional>
searchTimeout number <optional>
managementTimeout number <optional>
transcoder Transcoder <optional>
logFunc LoggingCallback <optional>
callback ConnectCallback <optional>

View Source cluster.js, line 125

Promise.<Cluster>

# analyticsIndexes() → {AnalyticsIndexManager}

Gets an analytics index manager for this cluster

View Source cluster.js, line 483

Never

# async analyticsQuery(query, optionsopt, callbackopt) → {Promise.<AnalyticsResult>}

Parameters:
Name Type Attributes Description
query string

The query string to execute.

options Object <optional>
parameters Object | Array <optional>

parameters specifies a list of values to substitute within the query statement during execution.

scanConsistency AnalyticsScanConsistency <optional>

scanConsistency specifies the level of consistency that is required for the results of the query.

clientContextId string <optional>

clientContextId specifies a unique identifier for the execution of this query to enable various tools to correlate the query.

priority boolean <optional>

priority specifies that this query should be executed with a higher priority than others, causing it to receive extra resources.

readOnly boolean <optional>

readOnly specifies that query should not be permitted to mutate any data. This option also enables a few minor performance improvements and the ability to automatically retry the query on failure.

raw Object <optional>

raw specifies an object represent raw key value pairs that should be included with the query.

timeout number <optional>

timeout specifies the number of ms to wait for completion before cancelling the operation and returning control to the application.

callback AnalyticsQueryCallback <optional>

View Source cluster.js, line 342

Promise.<AnalyticsResult>

# bucket(bucketName) → {Bucket}

Gets a reference to a bucket.

Parameters:
Name Type Description
bucketName string

View Source cluster.js, line 418

Never

Bucket

# buckets() → {BucketManager}

Gets a bucket manager for this cluster

View Source cluster.js, line 463

Never

# async close()

Closes all connections associated with this cluster. Any running operations will be cancelled. Further operations will cause new connections to be established.

View Source cluster.js, line 429

Never

# async diagnostics(optionsopt, callback) → {Promise.<DiagnosticsResult>}

Diagnostics returns stateful data about the current SDK connections.

Parameters:
Name Type Attributes Description
options Object <optional>
reportId string <optional>
callback DiagnosticsCallback

View Source cluster.js, line 159

Promise.<DiagnosticsResult>

# async query(query, optionsopt, callbackopt) → {Promise.<QueryResult>}

Parameters:
Name Type Attributes Description
query string

The query string to execute.

options Object <optional>
parameters Object | Array <optional>

parameters specifies a list of values to substitute within the query statement during execution.

scanConsistency QueryScanConsistency <optional>

scanConsistency specifies the level of consistency that is required for the results of the query.

consistentWith MutationState <optional>

consistentWith specifies a MutationState object to use when determining the level of consistency needed for the results of the query.

adhoc boolean <optional>

adhoc specifies that the query is an adhoc query and should not be prepared and cached within the SDK.

clientContextId string <optional>

clientContextId specifies a unique identifier for the execution of this query to enable various tools to correlate the query.

maxParallelism number <optional>
pipelineBatch number <optional>
pipelineCap number <optional>
scanWait number <optional>
scanCap number <optional>
readOnly boolean <optional>

readOnly specifies that query should not be permitted to mutate any data. This option also enables a few minor performance improvements and the ability to automatically retry the query on failure.

profile QueryProfileMode <optional>

profile enables the return of profiling data from the server.

metrics boolean <optional>

metrics enables the return of metrics data from the server

raw Object <optional>

raw specifies an object represent raw key value pairs that should be included with the query.

timeout number <optional>

timeout specifies the number of ms to wait for completion before cancelling the operation and returning control to the application.

callback QueryCallback <optional>

View Source cluster.js, line 283

Promise.<QueryResult>

# queryIndexes() → {QueryIndexManager}

Gets a query index manager for this cluster

View Source cluster.js, line 473

Never

# searchIndexes() → {SearchIndexManager}

Gets a search index manager for this cluster

View Source cluster.js, line 493

Never

# async searchQuery(indexName, query, optionsopt, callback) → {Promise.<SearchQueryResult>}

Parameters:
Name Type Attributes Description
indexName string

The name of the index to execute the query against.

query SearchQuery

The search query object describing the requested search.

options Object <optional>
skip number <optional>
limit number <optional>
explain boolean <optional>
highlight Object <optional>
highlight.style HighlightStyle <optional>
highlight.fields Array.<string> <optional>
fields Array.<string> <optional>
facets Array.<SearchFacet> <optional>
sort SearchSort <optional>
consistency SearchConsistency <optional>
consistentWith MutationState <optional>
timeout number <optional>
callback SearchQueryCallback

View Source cluster.js, line 394

Promise.<SearchQueryResult>

# users() → {UserManager}

Gets a user manager for this cluster

View Source cluster.js, line 453

Never

UserManager