\CouchbaseBucketManager

Provides management capabilities for the Couchbase Bucket

Summary

Methods
Properties
Constants
info()
flush()
listDesignDocuments()
getDesignDocument()
removeDesignDocument()
upsertDesignDocument()
insertDesignDocument()
listN1qlIndexes()
createN1qlPrimaryIndex()
createN1qlIndex()
dropN1qlPrimaryIndex()
dropN1qlIndex()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

info()

info() : array

Returns information about the bucket

Returns an associative array of status information as seen by the cluster for this bucket. The exact structure of the returned data can be seen in the Couchbase Manual by looking at the bucket /info endpoint.

Returns

array

flush()

flush() 

Flushes the bucket (clears all data)

listDesignDocuments()

listDesignDocuments() : array

Returns all design documents of the bucket.

Returns

array

getDesignDocument()

getDesignDocument(string  $name) : array

Get design document by its name

Parameters

string $name

name of the design document (without _design/ prefix)

Returns

array

removeDesignDocument()

removeDesignDocument(string  $name) 

Removes design document by its name

Parameters

string $name

name of the design document (without _design/ prefix)

upsertDesignDocument()

upsertDesignDocument(string  $name, array  $document) 

Creates or replaces design document.

Parameters

string $name

name of the design document (without _design/ prefix)

array $document

insertDesignDocument()

insertDesignDocument(string  $name, array  $document) 

Inserts design document and fails if it is exist already.

Parameters

string $name

name of the design document (without _design/ prefix)

array $document

listN1qlIndexes()

listN1qlIndexes() : array

List all N1QL indexes that are registered for the current bucket.

Returns

array

createN1qlPrimaryIndex()

createN1qlPrimaryIndex(string  $customName = '', boolean  $ignoreIfExist = false, boolean  $defer = false) 

Create a primary N1QL index.

Parameters

string $customName

the custom name for the primary index.

boolean $ignoreIfExist

if a primary index already exists, an exception will be thrown unless this is set to true.

boolean $defer

true to defer index building.

createN1qlIndex()

createN1qlIndex(string  $name, array  $fields, string  $whereClause = '', boolean  $ignoreIfExist = false, boolean  $defer = false) 

Create secondary N1QL index.

Parameters

string $name

name of the index

array $fields

list of JSON fields to index

string $whereClause

the WHERE clause of the index.

boolean $ignoreIfExist

if a secondary index already exists, an exception will be thrown unless this is set to true.

boolean $defer

true to defer index building.

dropN1qlPrimaryIndex()

dropN1qlPrimaryIndex(string  $customName = '', boolean  $ignoreIfNotExist = false) 

Drop the given primary index

Parameters

string $customName

the custom name for the primary index

boolean $ignoreIfNotExist

if a primary index does not exist, an exception will be thrown unless this is set to true.

dropN1qlIndex()

dropN1qlIndex(string  $name, boolean  $ignoreIfNotExist = false) 

Drop the given secondary index

Parameters

string $name

the index name

boolean $ignoreIfNotExist

if a secondary index does not exist, an exception will be thrown unless this is set to true.