This may be a very stupid question, but how I can be sure a document was inserted in the DB other than doing a document get?
when I do an insert document, I receive this response:
Couchbase\StoreResultImpl Object
(
[cas:Couchbase\StoreResultImpl:private] => AAAoBBUkPhY=
[expiry:Couchbase\StoreResultImpl:private] =>
[key:Couchbase\StoreResultImpl:private] => p:102a783e-8691-43d8-92bb-d7f5d18f7bbc
[status:Couchbase\StoreResultImpl:private] => 0
[err_ctx:Couchbase\StoreResultImpl:private] =>
[err_ref:Couchbase\StoreResultImpl:private] =>
[mutation_token:Couchbase\StoreResultImpl:private] => Couchbase\MutationTokenImpl Object
(
[partition_id:Couchbase\MutationTokenImpl:private] => 9
[partition_uuid:Couchbase\MutationTokenImpl:private] => sO5guqhVAAA=
[sequence_number:Couchbase\MutationTokenImpl:private] => AwAAAAAAAAA=
[bucket_name:Couchbase\MutationTokenImpl:private] => app
)
[is_stored:Couchbase\StoreResultImpl:private] =>
[num_persisted:Couchbase\StoreResultImpl:private] =>
[num_replicated:Couchbase\StoreResultImpl:private] =>
)
which value from all these can confirm the operation was 100% successful. All of these seems to be private, so not sure I will be able to access any.
I know if the document exists I get an exception \Couchase\KeyExistsException
but it doesn’t make sense to do two inserts to get an exception.
I could not find any example of how to do this correctly and It is hard to simulate all the possibilities in which the DB would fail.