orientechnologies / orientjs

The official fast, lightweight node.js client for OrientDB
http://orientdb.com
Other
326 stars 68 forks source link

Issue with update - remove #320

Closed antypasD closed 4 years ago

antypasD commented 6 years ago

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.

mahmed8003 commented 6 years ago

@antypasD There is a code snippet from one of my project. that may help.

db.query(`UPDATE ${user.rid} REMOVE loginActions = loginActions[token = '${token}']`)
                .then(function (result) {
                })
                .catch(function (err) {
                });
antypasD commented 6 years ago

This works great for me! Thank you very much for the help!