I would like to use php-ext-couchbase as it has more functions to choose from but it appears to be older on Github. Is one more official than the other?
Please More explain your question
I guess @fnsnoop is asking about the difference between https://github.com/couchbase/php-ext-couchbase which is place where 1.x SDK lives and https://github.com/couchbaselabs/php-couchbase which is new 2.0 series of PHP SDK
Thats the question, I am confused why the newer version doesnt have all the functions that the old one has. I am very interested in the setMulti() function.
I am also receiving some odd errors on the newer version. Every 8 or so gets on the same key, I receive this error.
Warning: Invalid callback , no array or string given in CouchbaseNative on line 1111
I think this is because I am running PHP 5.3 on a 64 bit system.
What kind of operations were you looking for that existed in the PHP 1.x series of client, but which is missing from the 2.x series? Additionally, can you post an example of your code which causes the periodic callback error?
I would like to insert more than 1 document at a time with a set command. The 1.x series has a setMulti().
My code for getting the error below.
$cluster = new CouchbaseCluster('127.0.0.1:8091','',''); $bucket = $cluster->openBucket('default'); $value = $bucket->get("key here"); echo "<pre>"; print_r($value); echo "</pre>";
This is still possible, it’s just rolled into the main set of operations, for instance:
$bucket->upsert(array( 'key1' => 'value1', 'key2' => 'value2' ));
I have tried this and both keys get inserted but the values dont make it. The values shows up as null.
I sincerely apologize, I forgot a level of array there:
$bucket->upsert(array( 'key1' => array('value' => 'value1'), 'key2' => array('value' => 'value2') ));
The additional level exists as you can specify various operation options on a per-key basis.
Could I question regarding this?
Is it possible with CAS value?
Actually, I’m looking for a solution like this.
But not easy to find any reference from newest document.
Could you please help on this as well?
You can put a CAS value as the ‘cas’ key of the inner array (alongside value).
Ok. Let me try it as you mentioned.
And ask you later if I have other problem.
Many thanks for kindly help.