Class

Cluster

Cluster

Cluster represents an entire Couchbase Server cluster.

Methods

# async static connect(connStr, optionsopt, callbackopt)

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

Parameters:
Name Type Attributes Description
connStr string
options * <optional>
username string <optional>
password string <optional>
clientCertificate string <optional>
certificateChain string <optional>
transcoder Transcoder <optional>
logFunc LoggingCallback <optional>
callback * <optional>

View Source cluster.js, line 78

CouchbaseError

Promise

# analyticsIndexes() → {AnalyticsIndexManager}

Gets an analytics index manager for this cluster

View Source cluster.js, line 414

Never

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

Parameters:
Name Type Attributes Description
query string

The query string to execute.

options * <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 integer <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 283

CouchbaseError

Promise.<AnalyticsResult>

# bucket(bucketName) → {Bucket}

Gets a reference to a bucket.

Parameters:
Name Type Description
bucketName string

View Source cluster.js, line 351

Never

Bucket

# buckets() → {BucketManager}

Gets a bucket manager for this cluster

View Source cluster.js, line 394

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 362

Never

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

Diagnostics returns stateful data about the current SDK connections.

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

View Source cluster.js, line 108

CouchbaseError

Promise.<DiagnosticsResult>

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

Parameters:
Name Type Attributes Description
query string

The query string to execute.

options * <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 integer <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 228

CouchbaseError

Promise.<QueryResult>

# queryIndexes() → {QueryIndexManager}

Gets a query index manager for this cluster

View Source cluster.js, line 404

Never

# searchIndexes() → {SearchIndexManager}

Gets a search index manager for this cluster

View Source cluster.js, line 424

Never

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

Parameters:
Name Type Attributes Description
query SearchQuery

The search query object describing the requested search.

options *
skip number <optional>
limit number <optional>
explain boolean <optional>
highlight 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 327

Promise.<SearchQueryResult>

# users() → {UserManager}

Gets a user manager for this cluster

View Source cluster.js, line 384

Never

UserManager