Search:

Search all manuals
Search this manual
Manual
Couchbase Client Library: PHP 1.1
Community Wiki and Resources
Wiki: PHP Client Library
PHP Client Library
Couchbase Developer Guide 2.0
Couchbase Server Manual 2.0
SDK Forum
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
4 Connection Operations
Chapter Sections
Chapters

4.4. Obtain the Number of Replicas

To obtain a count of the number of configured replicas for a given bucket, use the getNumReplicas() method. You should use in combination with operations that enforce or monitor the durability of a stored document to determine if the document has been stored on all the configured replicas.

API Call$object->getNumReplicas()
Asynchronousno
Description Returns the number of replicas for the configured bucket
Returnsscalar ( Number of replicas )
Arguments 
 None  
Errors 
CouchbaseAuthenticationException Authentication to the Couchbase cluster failed
CouchbaseException Base exception class for all Couchbase exceptions
CouchbaseIllegalKeyException The key provided is not a legal key identifier
CouchbaseLibcouchbaseException An error occurred within the libcouchbase library used by th PHP extension
CouchbaseServerException An error occurred within the Couchbase cluster

The method returns an integer count of the number of replicas configured for the Couchbase Server bucket.