Ostico / PhpOrient

PhpOrient - Official Php driver based on the binary protocol of OrientDB.
Other
68 stars 37 forks source link

function recordUpdate cannot upsert? #95

Closed lightjiao closed 7 years ago

lightjiao commented 7 years ago

http://orientdb.com/docs/last/PHP-recordUpdate.html In this page I see a word

Using this method you can update existing records on the database. In the event that you attempt to update a record that does not exist, this method creates it for you.

But I got a exception below when I execute my test code.

com.orientechnologies.orient.core.exception.ORecordNotFoundException: The record with id '#-1:-1' was not found

my test code

$edgeData = [
    "in" => "#57:11",
    "out" => "#59:10",
];

$record = new Record();
$record->setOClass("e_test")->setOData($edgeData);

// 创建edge
// $result = $orientDB->recordCreate($record);
// 更新edge
$result = $orientDB->recordUpdate($record);

It's a BUG? or I used in a wrong way? or the document is not newest?

and…… I found a issue https://github.com/orientechnologies/orientdb/issues/7326

hi,

There is no plan to support this in short term in the binary protocol, in the same way that we ?don't provide a Java API to do upsert, I'll forward this issue to a late version just to keep track in case of feature development on upsert.

Regards

Please update the document, Thank you

Ostico commented 7 years ago

@lightjiao , sorry i not wrote personally this document.

In the Readme this is correct, i will forward to the OrientDB-document team the change.