I am trying to make an application (in PHP) using the Couchbase DB, but I encounter a problem which I dont’t know how to handle.
If I check if a document exists with something similar to this:
$result = CouchbaseClient::getCollection($bucketName) ->exists($documentKey) ->exists();
I get a false response (document doesn’t exists)
(I want to mention that for some keys the above code return the correct response)
after this if I try to insert a document with the same key, I get an error saying that the document exists:
Couchbase\KeyExistsException: LCB_ERR_DOCUMENT_EXISTS (305)
sometime I also get this error
Couchbase\DurabilityException: LCB_ERR_DURABLE_WRITE_IN_PROGRESS (310)
From what I understand it seems that the document exists() method doesn’t really return the correct result if the document was just written, or something similar.
Can somebody please help me fix this?
I use couchbase 6.6 and PHP sdk 3.0