Orientjs - Issue with update remove

68 Views Asked by At

I am sorry if this has been asked before but I did a quick search and did not found something. I am having a problem with a query similar to "update #48:1 remove tags[0]", where "tags" is an Embedded list. When I ran the command in the console it works just fine but when I use db.query("update #48:1 remove tags[0]"); in node it does nothing. I was wondering if there is an issue with the brackets because if I choose to remove the whole list, db.query("update #48:1 remove tags");, it works fine. I tried escaping the brackets but still no luck. Tried the code both with Orient2.2 and Orient3.

1

There are 1 best solutions below

0
antypasD On

As far as I can remember, there were no errors in the orientdb window. However, I tried this solution as suggested in https://github.com/orientechnologies/orientjs/issues/320:

`db.query(`UPDATE ${id} REMOVE tags = tags['${index}']`)`

and works fine now.