I am trying to sync documents from Couchbase to MySql but I am not able to do so
The above operation is taking place with a cron job (Drupal)
function drupal_cron()
{
$cluster = new CouchbaseCluster("couchbase://localhost");
$cluster->authenticateAs('Admin', 'password');
$bucket = $cluster->openBucket("default");
$query = CouchbaseViewQuery::from('drupal', 'id')->reduce(false)->order(CouchbaseViewQuery::ORDER_DESCENDING);
var_dump($query); // getting data till here
$results = $bucket->query($query); // not going past this
var_dump($results); // no data here
foreach($results->rows as $row)
{ //not going in the foreach loop because no data in $results
$doc_id = $row->id;
$doc = $bucket->get($doc_id);
// $doc = json_decode($doc->value);
$doc = $doc->value;
if ($doc->drupal_status == 'pending')
{
sync_code_here
}
}
}
The output of var_dump($query)
object(Couchbase\ViewQuery)#108 (3) {
["designDocumentName"]=> string(8) "drupal"
["viewName"]=> string(2) "id"
["options"]=> array(2) {
["reduce"]=> string(5) "false"
["descending"]=> string(4) "true"
}
}
NOTE: The above code was working fine in Couchbase Enterprise Edition 5.0.1 build 5003 but when I updated the Couchbase to Couchbase Enterprise Edition 6.0.0 build 1693 ‧ IPv4 it is not working.
Pls help
How do I fix this?