JSON format by get


When I do a query like:

$res = $myBucket->get('DocumentName');

If the output response using



echo json_encode($res);

In response, I get no JSOn format.
The question is how to get the answer in the JSON format


Hey Kozlov,

The CouchbaseBucket methods all return Document objects. If you wish to access the value of the document as JSON, try something like:

$res = $myBucket->get('DocumentName');
echo json_encode($res->value);

Cheers, Brett