Class

Collection

Collection

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

Methods

# binary() → {BinaryCollection}

View Source collection.js, line 1042

Never

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

Parameters:
Name Type Attributes Description
key string
options * <optional>
timeout integer <optional>
callback ExistsCallback <optional>

View Source collection.js, line 325

Promise.<ExistsResult>

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

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

View Source collection.js, line 187

Promise.<GetResult>

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

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

View Source collection.js, line 440

Promise.<Array.<GetReplicaResult>>

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

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

View Source collection.js, line 730

Promise.<GetAndLockCallback>

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

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

View Source collection.js, line 621

Promise.<GetAndTouchResult>

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

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

View Source collection.js, line 419

Promise.<GetReplicaResult>

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

Parameters:
Name Type Attributes Description
key string
value *
options *
transcoder Transcoder <optional>
timeout integer <optional>
callback MutationCallback

View Source collection.js, line 511

Promise.<MutationResult>

# list(key) → {CouchbaseList}

Parameters:
Name Type Description
key string

View Source collection.js, line 1000

Never

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

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

View Source collection.js, line 887

Promise.<LookupInResult>

# map(key) → {CouchbaseMap}

Parameters:
Name Type Description
key string

View Source collection.js, line 1022

Never

CouchbaseMap

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

Parameters:
Name Type Attributes Description
key string
spec MutateInSpec
options * <optional>
timeout integer <optional>
callback MutateInCallback <optional>

View Source collection.js, line 953

Promise.<MutateInResult>

# queue(key) → {CouchbaseQueue}

Parameters:
Name Type Description
key string

View Source collection.js, line 1011

Never

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

Parameters:
Name Type Attributes Description
key string
options *
timeout integer <optional>
callback RemoveCallback <optional>

View Source collection.js, line 565

Promise.<RemoveResult>

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

Parameters:
Name Type Attributes Description
key string
value *
options *
transcoder Transcoder <optional>
timeout integer <optional>
cas Cas <optional>
callback MutationCallback

View Source collection.js, line 544

Promise.<MutationResult>

# set(key) → {CouchbaseSet}

Parameters:
Name Type Description
key string

View Source collection.js, line 1033

Never

CouchbaseSet

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

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

View Source collection.js, line 674

Promise.<TouchResult>

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

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

View Source collection.js, line 784

Promise.<UnlockResult>

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

Parameters:
Name Type Attributes Description
key string
value *
options * <optional>
transcoder Transcoder <optional>
timeout integer <optional>
callback MutationCallback

View Source collection.js, line 527

Promise.<MutationResult>