Upgrade php couchbase 2.1.0

Hi,
after upgrade from php couchbase 2.0.7 to 2.1.0 with same versione of code i have this error:
PHP Fatal error: Cannot use object of type stdClass as array in [CouchbaseNative]/CouchbaseBucket.class.php

I need to make some changes in code?

I have latest libcouchbase installed 2.5.3 and fastlz library intsalled.

Thanks,
Jacopo

Hey @jacopo,

Can you show the snippet of code which is failing with that error? There is a known issue with the new json_as_array argument that has been added to the query method, but you should only encounter this issue if you have changed your code to try and use it.

Cheers, Brett

Same trouble for me…

$Query = \CouchbaseViewQuery::from('_design/region_key_value', 'KeyValueRegion')
$Connection->openBucket('default')->query( $Query ) --> Fatal error

The web-manager looks like this:

“Random”-Document [Example] (doc and meta):

{
   "Key": "Payload-Name",
   "Value": "s:7:\"Payload\";"
}
{
   "id": "Example",
   "rev": "25-141da9b6315100000000000004000000",
   "expiration": 0,
   "flags": 67108864
}

“Mapping”-Function

function (doc, meta) {
  emit(doc.Key, doc.Value);
}

“Reduce”-Function

Not used (empty)

“Result”-Gui

“Payload-Name"
Example
"s:7:“Payload”;”

“Result”-Link (on Gui) ?inclusive_end=true&stale=false&connection_timeout=60000&limit=10&skip=0

{"total_rows":1,"rows":[
{"id":"Example","key":"Payload-Name","value":"s:7:\"Payload\";"}
]
}

Using this however i get the “Result”-Link response

$Connection->openBucket('default')->_view( $Query, true )

But i can’t find a proper documentation on this (the second parameter with _view is just plain personal guessing)

Hey Guys,

Can you try the following:

$Query = \CouchbaseViewQuery::from('_design/region_key_value', 'KeyValueRegion')
$Connection->openBucket('default')->query( $Query, null, true );

Cheers, Brett