Aus irgendeinem Grund erhalte ich folgende Fehlermeldung:Cloudant CouchDB Dokument aktualisieren Konflikt
Fatal error: Uncaught exception 'PHPOnCouch\Exceptions\CouchConflictException' with message 'Conflict - Document update conflict.
Fatal error: Uncaught exception 'PHPOnCouch\Exceptions\CouchConflictException' with message 'Conflict - Document update conflict. (PUT /u12345/678bb21541f0ed5e67df1a9070000b55 [])' in /.../vendor/popojargo/php-on-couch/src/Exceptions/CouchException.php:74
Stack trace:
#0 /.../vendor/popojargo/php-on-couch/src/CouchClient.php(168): PHPOnCouch\Exceptions\CouchException::factory(Array, 'PUT', '/u12345...', Array)
#1 /.../vendor/popojargo/php-on-couch/src/CouchClient.php(582): PHPOnCouch\CouchClient->_queryAndTest('PUT', '/u12345...', Array, Array, Object(stdClass))
#2 /.../test.php(46): PHPOnCouch\CouchClient->storeDoc(Object(stdClass))
#3 /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Res in /.../vendor/popojargo/php-on-couch/src/Exceptions/CouchException.php on line 74
ich die Revision entfernen, damit ich bin nicht sicher, warum sonst ein Dokument Update Konflikt auftreten würde.
Hat jemand einen Einblick? Es würde sehr geschätzt werden.
Die Objekte sehen aus wie dieses
{
"_id": "678bb21541f0ed5e67df1a9070000b55",
"_rev": "3-c0ea1980545a80839677d658eec0df78",
"name": "Other",
"timestamp": 0
}
My-Code
$userClient = new CouchClient("http://admin:[email protected]:8080", "u12345");
$all_documents = $userClient->include_docs(TRUE)->getAllDocs();
foreach ($all_documents->rows as $d) {
$doc = $d->doc;
unset($doc->_rev);
$doc->timestamp = 0;
$userClient->storeDoc($doc);
}
Das macht großen Sinn, danke für die Erklärung! – bryan