CouchbaseBucket

Represents a bucket connection.

Note: This class must be constructed by calling the openBucket method of the CouchbaseCluster class.

package

Couchbase

see

Methods

Returns an instance of a CouchbaseBucketManager for performing management operations against a bucket.

manager() : \CouchbaseBucketManager

Enables N1QL support on the client. A cbq-server URI must be passed.

enableN1ql(mixed $hosts) 

This method will be deprecated in the future in favor of automatic configuration through the connected cluster.

Arguments

$hosts

mixed

An array of host/port combinations which are N1QL servers attached to the cluster.

Inserts a document. This operation will fail if the document already exists on the cluster.

insert(string|array $ids, mixed $val = NULL, array $options = array()) : mixed

Arguments

$ids

string|array

$val

mixed

$options

array

expiry,flags

Response

mixed

Inserts or updates a document, depending on whether the document already exists on the cluster.

upsert(string|array $ids, mixed $val = NULL, array $options = array()) : mixed

Arguments

$ids

string|array

$val

mixed

$options

array

expiry,flags

Response

mixed

Replaces a document.

replace(string|array $ids, mixed $val = NULL, array $options = array()) : mixed

Arguments

$ids

string|array

$val

mixed

$options

array

cas,expiry,flags

Response

mixed

Appends content to a document.

append(string|array $ids, mixed $val = NULL, array $options = array()) : mixed

Arguments

$ids

string|array

$val

mixed

$options

array

cas

Response

mixed

Prepends content to a document.

prepend(string|array $ids, mixed $val = NULL, array $options = array()) : mixed

Arguments

$ids

string|array

$val

mixed

$options

array

cas

Response

mixed

Deletes a document.

remove(string|array $ids, array $options = array()) : mixed

Arguments

$ids

string|array

$options

array

cas

Response

mixed

Retrieves a document.

get(string|array $ids, array $options = array()) : mixed

Arguments

$ids

string|array

$options

array

lock

Response

mixed

Retrieves a document and simultaneously updates its expiry.

getAndTouch(string $id, integer $expiry, array $options = array()) : mixed

Arguments

$id

string

$expiry

integer

$options

array

Response

mixed

Retrieves a document and locks it.

getAndLock(string $id, integer $lockTime, array $options = array()) : mixed

Arguments

$id

string

$lockTime

integer

$options

array

Response

mixed

Retrieves a document from a replica.

getFromReplica(string $id, array $options = array()) : mixed

Arguments

$id

string

$options

array

Response

mixed

Increment or decrements a key (based on $delta).

counter(string|array $ids, integer $delta, array $options = array()) : mixed

Arguments

$ids

string|array

$delta

integer

$options

array

initial,expiry

Response

mixed

Unlocks a key previous locked with a call to get().

unlock(string|array $ids, array $options = array()) : mixed

Arguments

$ids

string|array

$options

array

cas

Response

mixed

Performs a query (either ViewQuery or N1qlQuery).

query(\CouchbaseQuery $query) : mixed
throws

Arguments

$query

\CouchbaseQuery

Response

mixed

Flushes a bucket (clears all data).

flush() : mixed

Response

mixed

Sets custom encoder and decoder functions for handling serialization.

setTranscoder(string $encoder, string $decoder) 

Arguments

$encoder

string

The encoder function name

$decoder

string

The decoder function name

Properties

operationTimeout

operationTimeout : integer

Type(s)

integer

viewTimeout

viewTimeout : integer

Type(s)

integer

durabilityInterval

durabilityInterval : integer

Type(s)

integer

durabilityTimeout

durabilityTimeout : integer

Type(s)

integer

httpTimeout

httpTimeout : integer

Type(s)

integer

configTimeout

configTimeout : integer

Type(s)

integer

configDelay

configDelay : integer

Type(s)

integer

configNodeTimeout

configNodeTimeout : integer

Type(s)

integer

htconfigIdleTimeout

htconfigIdleTimeout : integer

Type(s)

integer