Couchbase::Settings - Settings for a Couchbase::Bucket
my $settings = $bucket->settings(); $settings->{operation_timeout} = 5.0; # Or $bucket->settings->{json_encoder} = sub { encode_json(shift) };
This object represents a tied hash which can modify settings for an Couchbase::Bucket. Being a hash, the values can be localized per-operation using Perl's local operator.
local
The following contains a list of setting keys and their accepted values:
operation_timeout
The default timeout for the library when trying to perform simple document operations. This accepts a timeout value in seconds (fractional seconds are also allows)
view_timeout
The default timeout for the library when trying to read data from a view query. This accepts a timeout value in seconds.
bucket
This read only setting returns the name of the bucket this Couchbase::Bucket is connected to.
json_encoder
Takes a subroutine reference which returns an encoded JSON string from a Perl object. This may be used if you wish to use an alternate JSON encoder. The function is passed a single argument, which is a reference (or simple scalar) to encode.
json_decoder
Takes a subroutine reference which decodes JSON. It is passed a single argument which is the JSON encoded string to decode.
To install Couchbase, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Couchbase
CPAN shell
perl -MCPAN -e shell install Couchbase
For more information on module installation, please visit the detailed CPAN module installation guide.