orientjs
orientjs copied to clipboard
Error on delete in update on OrientDB 3.0.0
Exact error:
OrientDB.RequestError: Error on parsing command: Found unexpected keyword 'ELOGAIN' while it was expected '[=, WHERE]'. Use UPDATE <class>|cluster:<cluster>> [SET|ADD|PUT|REMOVE|INCREMENT|CONTENT {<JSON>}|MERGE {<JSON>}] [[,] <field-name> = <expression>|<sub-command>]* [LOCK <NONE|RECORD>] [UPSERT] [RETURN <COUNT|BEFORE|AFTER>] [WHERE <conditions>]
Command: UPDATE `registration` SET status = 2 REMOVE result, eloGain WHERE (`status` = 0 ) AND both("registration_tournament")["_id"] = "<id here>"
When I run this code in the console online I'm seeing no issue, running this through orientjs though results in an error. Our previous working code on 2.2 did not work in the console or through orientjs on the 3.0 DB:
Found unexpected keyword \'REMOVE\' while it was expected \'[=, WHERE]\'. Use UPDATE <class>|cluster:<cluster>> [SET|ADD|PUT|REMOVE|INCREMENT|CONTENT {<JSON>}|MERGE {<JSON>}] [[,] <field-name> = <expression>|<sub-command>]* [LOCK <NONE|RECORD>] [UPSERT] [RETURN <COUNT|BEFORE|AFTER>] [WHERE <conditions>]\nCommand: UPDATE `tournament` SET checkInOpen = true REMOVE ongoing REMOVE dateFinished REMOVE prizepool WHERE `_id` = "<id here>" LIMIT 1
Hi @33Fraise33
Switching to new OrientJS API https://orientdb.com/docs/3.0.x/orientjs/OrientJS.html
Should solve the issue
Thanks