Class

Collection

Collection

Collection provides an interface for performing operations against a collection within the cluster.

Methods

# binary() → {BinaryCollection}

View Source collection.js, line 1282

Never

# async exists(key, optionsopt, callbackopt) → {Promise.<ExistsResult>}

Parameters:
Name Type Attributes Description
key string
options Object <optional>
timeout number <optional>
callback ExistsCallback <optional>

View Source collection.js, line 382

Promise.<ExistsResult>

# async get(key, optionsopt, callbackopt) → {Promise.<GetResult>}

Parameters:
Name Type Attributes Default Description
key string
options Object <optional>
project Array.<string> <optional>
withExpiry boolean <optional>
false
transcoder Transcoder <optional>
timeout number <optional>
callback GetCallback <optional>

View Source collection.js, line 206

Promise.<GetResult>

# async getAllReplicas(key, optionsopt, callbackopt) → {Promise.<Array.<GetReplicaResult>>}

Parameters:
Name Type Attributes Description
key string
options Object <optional>
transcoder Transcoder <optional>
timeout number <optional>
callback GetAllReplicasCallback <optional>

View Source collection.js, line 523

Promise.<Array.<GetReplicaResult>>

# async getAndLock(key, lockTime, optionsopt, callbackopt) → {Promise.<GetAndLockCallback>}

Parameters:
Name Type Attributes Description
key string
lockTime number
options Object <optional>
transcoder Transcoder <optional>
timeout number <optional>
callback GetAndLockCallback <optional>

View Source collection.js, line 886

Promise.<GetAndLockCallback>

# async getAndTouch(key, expiry, optionsopt, callbackopt) → {Promise.<GetAndTouchResult>}

Parameters:
Name Type Attributes Description
key string
expiry number
options Object <optional>
transcoder Transcoder <optional>
timeout number <optional>
callback GetAndTouchCallback <optional>

View Source collection.js, line 745

Promise.<GetAndTouchResult>

# async getAnyReplica(key, optionsopt, callbackopt) → {Promise.<GetReplicaResult>}

Parameters:
Name Type Attributes Description
key string
options Object <optional>
transcoder Transcoder <optional>
timeout number <optional>
callback GetAnyReplicaCallback <optional>

View Source collection.js, line 497

Promise.<GetReplicaResult>

# async insert(key, value, optionsopt, callbackopt) → {Promise.<MutationResult>}

Parameters:
Name Type Attributes Description
key string
value *
options Object <optional>
transcoder Transcoder <optional>
expiry Number <optional>
timeout number <optional>
callback MutateCallback <optional>

View Source collection.js, line 615

Promise.<MutationResult>

# list(key) → {CouchbaseList}

Parameters:
Name Type Description
key string

View Source collection.js, line 1240

Never

# async lookupIn(key, spec, optionsopt, callbackopt) → {Promise.<LookupInResult>}

Parameters:
Name Type Attributes Description
key string
spec Array.<LookupInSpec>
options Object <optional>
timeout number <optional>
callback LookupInCallback <optional>

View Source collection.js, line 1076

Promise.<LookupInResult>

# map(key) → {CouchbaseMap}

Parameters:
Name Type Description
key string

View Source collection.js, line 1262

Never

CouchbaseMap

# async mutateIn(key, spec, optionsopt, callbackopt) → {Promise.<MutateInResult>}

Parameters:
Name Type Attributes Description
key string
spec MutateInSpec
options Object <optional>
cas Cas <optional>
timeout number <optional>
callback MutateInCallback <optional>

View Source collection.js, line 1166

Promise.<MutateInResult>

# queue(key) → {CouchbaseQueue}

Parameters:
Name Type Description
key string

View Source collection.js, line 1251

Never

# async remove(key, optionsopt, callbackopt) → {Promise.<RemoveResult>}

Parameters:
Name Type Attributes Description
key string
options Object <optional>
timeout number <optional>
callback RemoveCallback <optional>

View Source collection.js, line 678

Promise.<RemoveResult>

# async replace(key, value, optionsopt, callbackopt) → {Promise.<MutationResult>}

Parameters:
Name Type Attributes Description
key string
value *
options Object <optional>
transcoder Transcoder <optional>
expiry Number <optional>
timeout number <optional>
cas Cas <optional>
callback MutateCallback <optional>

View Source collection.js, line 648

Promise.<MutationResult>

# set(key) → {CouchbaseSet}

Parameters:
Name Type Description
key string

View Source collection.js, line 1273

Never

CouchbaseSet

# async touch(key, expiry, optionsopt, callbackopt) → {Promise.<TouchResult>}

Parameters:
Name Type Attributes Description
key string
expiry number
options Object <optional>
timeout number <optional>
callback TouchCallback <optional>

View Source collection.js, line 819

Promise.<TouchResult>

# async unlock(key, cas, optionsopt, callbackopt) → {Promise.<UnlockResult>}

Parameters:
Name Type Attributes Description
key string
cas Cas
options Object <optional>
timeout number <optional>
callback UnlockCallback <optional>

View Source collection.js, line 950

Promise.<UnlockResult>

# async upsert(key, value, optionsopt, callbackopt) → {Promise.<MutationResult>}

Parameters:
Name Type Attributes Description
key string
value *
options Object <optional>
transcoder Transcoder <optional>
expiry Number <optional>
timeout number <optional>
callback MutateCallback <optional>

View Source collection.js, line 631

Promise.<MutationResult>