Documentation

Bucket

Bucket is an object containing functionality for performing bucket level operations against a cluster and for access to scopes and collections.

Table of Contents

defaultScope() Returns a new Scope object representing the default scope. Scope
defaultCollection() Returns a new Collection object representing the default collectiom. Collection
scope() Returns a new Scope object representing the given scope. Scope
setTranscoder() Sets the default transcoder to be used when fetching or sending data. mixed
name() Returns the name of the Bucket. string
viewQuery() Executes a view query against the cluster. ViewResult
collections() Creates a new CollectionManager object for managing collections and scopes. CollectionManager
viewIndexes() Creates a new ViewIndexManager object for managing views and design documents. ViewIndexManager
ping() Executes a ping for each service against each node in the cluster. This can be used for determining the current health of the cluster. mixed
diagnostics() Returns diagnostics information about connections that the SDK has to the cluster. This does not perform any operations. mixed

Methods

defaultScope()

Returns a new Scope object representing the default scope.

public defaultScope( ) : Scope
Return values
Scope

defaultCollection()

Returns a new Collection object representing the default collectiom.

public defaultCollection( ) : Collection
Return values
Collection

scope()

Returns a new Scope object representing the given scope.

public scope( $name : string ) : Scope
Parameters
$name : string

the name of the scope

Return values
Scope

setTranscoder()

Sets the default transcoder to be used when fetching or sending data.

public setTranscoder( $encoder : callable , $decoder : callable ) : mixed
Parameters
$encoder : callable

the encoder to use to encode data when sending data to the server

$decoder : callable

the decoder to use to decode data when retrieving data from the server

Return values
mixed

name()

Returns the name of the Bucket.

public name( ) : string
Return values
string

viewQuery()

Executes a view query against the cluster.

public viewQuery( $designDoc : string , $viewName : string [, $options : ViewOptions = null ] ) : ViewResult
Parameters
$designDoc : string

the design document to use for the query

$viewName : string

the view to use for the query

$options : ViewOptions = null

the options to use when executing the query

Return values
ViewResult

ping()

Executes a ping for each service against each node in the cluster. This can be used for determining the current health of the cluster.

public ping( $services : mixed , $reportId : mixed ) : mixed
Parameters
$services : mixed

the services to ping against

$reportId : mixed

a name which will be included within the ping result

Return values
mixed

diagnostics()

Returns diagnostics information about connections that the SDK has to the cluster. This does not perform any operations.

public diagnostics( $reportId : mixed ) : mixed
Parameters
$reportId : mixed

a name which will be included within the ping result

Return values
mixed

Search results