I have the following php logic that queries a couchbase database:
$myCluster = new CouchbaseCluster('couchbase://localhost');
$bucket = $myCluster->openBucket('reporting');
$result = $bucket->get('server_details_1');
$doc = $result->value;
var_dump($doc);
echo $doc->server_details->name."\n";
It's failing on the last line because I believe the way I'm trying to access the json object is incorrect. Perhaps it's no longer a json object... I'm not too sure. But I do know that couchbase stores it as json in the database itself.
This is what the var_dump command returns which shows you the structure of the object:
string '{"server_details":{"name":"test_server","dns_name":"test.server.mydomain.net","ipv4":"10.1.16.106","ipv6":"","type":"primary"},"server_status":{"up_to_date":true},"packages":{"pack1":{"current_version":"x.x","previous_version":"x.x","last_updated_on":"2016-03-16","play_id":"link to audit table"},"pack2":{"current_version":"x.x","previous_version":"x.x","last_updated_on":"2016-03-16","play_id":"link to audit table"}}}' (length=438)