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 138

Promise.<Cluster>

# analyticsIndexes() → {AnalyticsIndexManager}

Gets an analytics index manager for this cluster

View Source cluster.js, line 546

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 404

Promise.<AnalyticsResult>

# bucket(bucketName) → {Bucket}

Gets a reference to a bucket.

Parameters:
Name Type Description
bucketName string

View Source cluster.js, line 481

Never

Bucket

# buckets() → {BucketManager}

Gets a bucket manager for this cluster

View Source cluster.js, line 526

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 492

Never

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

Diagnostics returns stateful data about the current SDK connections.

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

View Source cluster.js, line 172

Promise.<DiagnosticsResult>

# async ping(optionsopt, callbackopt) → {Promise.<PingResult>}

Ping returns information from pinging the connections for this cluster.

Parameters:
Name Type Attributes Description
options Object <optional>
reportId string <optional>
serviceTypes Array.<ServiceType> <optional>
timeout number <optional>
callback PingCallback <optional>

View Source cluster.js, line 269

Promise.<PingResult>

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

flexIndex boolean <optional>

flexIndex specifies to enable the use of FTS indexes when selecting indexes to use for the query.

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 345

Promise.<QueryResult>

# queryIndexes() → {QueryIndexManager}

Gets a query index manager for this cluster

View Source cluster.js, line 536

Never

# searchIndexes() → {SearchIndexManager}

Gets a search index manager for this cluster

View Source cluster.js, line 556

Never

# async searchQuery(indexName, query, optionsopt, callbackopt) → {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>
disableScoring boolean <optional>
consistency SearchScanConsistency <optional>
consistentWith MutationState <optional>
timeout number <optional>
callback SearchQueryCallback <optional>

View Source cluster.js, line 457

Promise.<SearchQueryResult>

# users() → {UserManager}

Gets a user manager for this cluster

View Source cluster.js, line 516

Never

UserManager