When I update an atomic counter with n1ql, the document becomes unusual. It throws the following error when trying to increase via SDK. I used update query explained in How to update atomic counter with n1ql?
Error: LCB_DELTA_BADVAL: The value requested to be incremented is not stored as a number
When I did exactly
Updated an existing atomic counter with "update myBucket use keys "keyName" set myBucket=newNumber"
Tried to increase the document in PHP SDK $bucket->counter('keyName', 1)
Sorry for the delay again. I’m trying to make sure I give you the exact information since I was a little confused as well. It did not work at work, but worked at home just fine.
Only difference is that I’m using 4.6.1-3652 Enterprise Edition at work, but 5.0 at home.
Steps to reproduce
insert into default values("k01",1);
in PHP SDK
$cluster = new CouchbaseCluster('couchbase://127.0.0.1:8091');
$bucket = $cluster->openBucket('default');
$bucket->counter('k01', 1);
Then this throws exception.
Update: I haven’t tested it with the latest SDK. I tested it with SDK 2.1.o