Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REMOVE element from LINKSET with subquery doesn't work #8647

Closed
freeart opened this issue Nov 6, 2018 · 1 comment
Closed

REMOVE element from LINKSET with subquery doesn't work #8647

freeart opened this issue Nov 6, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@freeart
Copy link

freeart commented Nov 6, 2018

OrientDB Version: 3.1.0 from develop branch

Java Version: docker openjdk:8-jdk-alpine

OS: docker openjdk:8-jdk-alpine

Steps to reproduce

CREATE CLASS Test;
CREATE CLASS TestMap;
CREATE PROPERTY Test.mymap LINKSET TestMap;

INSERT INTO TestMap (name) VALUES ('test');
INSERT INTO TestMap (name) VALUES ('test2');

//works
INSERT INTO Test SET mymap = (SELECT FROM TestMap WHERE name = 'test')
select mymap:{name} from Test // [{"name": "test"}]

//works
UPDATE Test set mymap = (SELECT FROM TestMap WHERE name = 'test2') || mymap
select mymap:{name} from Test // [{"name": "test"},{"name": "test2"}]

//doesn't work
UPDATE Test remove mymap = (SELECT @rid FROM TestMap WHERE name = 'test2')
select mymap:{name} from Test // [{"name": "test"},{"name": "test2"}]

//doesn't work
UPDATE Test remove mymap = (SELECT FROM TestMap WHERE name = 'test2')
select mymap:{name} from Test // [{"name": "test"},{"name": "test2"}]

//works by rid only
UPDATE Test remove mymap = #xx:x
select mymap:{name} from Test // [{"name": "test"}]
@luigidellaquila
Copy link
Member

Hi @freeart

I just pushed a fix, now the following works fine:

UPDATE Test remove mymap = (SELECT FROM TestMap WHERE name = 'test2')

Thanks

Luigi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants