Open grimace opened 5 years ago
We also have this problem using orientjs. Possible in studio and apparently also using the java api/driver. How can we get around it?
Hi @dargolith
do you have an example of this failing? Which api are you using?
Thanks
@dargolith
if you are manually writing the query you should use backtick to escape reserved character
`x-men-apocalypse`
@wolf4ood
Sorry for replying so late.
This is what I do:
const client = await OrientDBClient.connect(dbConnectionData);
const session = await client.session(dbData);
const query = session.update(className);
query.set(properties);
If properties contain keys with "-" in their name, this throws:
Error: Error parsing query:
^
Encountered " <UPDATE> "UPDATE "" at line 1, column 1.
Was expecting one of:
<WHILE> ...
<IF> ...
<FOREACH> ...
";" ...
DB name=<myDbName>
Error Code="1"
I ran into this because I was importing events from some calendar and those events had dashes ('-') in the properties. I eventually just changed the import code to replaceAll dashes to underscores. Since it was not core to my task, I just moved on, but it's no longer an issue for me.
I have 'Event' records with fields like this ( x-cost-type ). I can not create/update any records and include that field in the update.
I can create/update a Vertex like this (note underscore instead of dash):
but not like this:
Is there a way around this? Or do I just not understand some limitation of ODB? I can create these fields in studio ( and via Java ) but not orientjs.