Description
For following test code
<?php
|
|
// ...
|
$key1 = 'key1'; |
$key2 = 'key2'; |
|
$collection->upsertMulti([[$key1, 'dummy'], [$key2, 'dummy']]); |
$collection->getAndLock($key2, 10); |
$collection->upsertMulti([[$key1, 'changed'], [$key2, 'changed']]); |
|
var_dump(array_map(fn ($doc) => $doc->content(), $collection->getMulti([$key1, $key2])));
|
Ideally, it should return an array of two items, where first item is a valid Couchbase document, and the 2nd one is an error document (with error code COUCHBASE_KEY_EEXISTS), as in previous major versions of Couchbase.
However, it returns the following output under Couchbase v4.1.6:
array(2) { |
[0]=> |
string(7) "changed" |
[1]=> |
string(5) "dummy" |
}
|
As we can see, the batch operation fails to update the 2nd item silently.