A newer version of this documentation is available.

View Latest

Operation basics

Operations use basic PHP data types.

Data types

Most PHP data types that can be serialized via the JSON functions are supported by default. Recursive structures cannot be serialized. All textual data is represented by UTF-8 when stored to Couchbase Server. You may alternatively implement your own transcoders which modify the method by which your documents are serialized to Couchbase. The following is an example of a transcoder which will transcode all documents as UTF-8 encoded JSON documents.

$bucket->setTranscoder(function($value) {
  return array(json_encode($value), 0, 0);
}, function($value, $flags, $datatype) {
  return json_decode($value, true);
});