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

CREATE EDGE vs UPDATE ... UPSERT -> look like as same but behavior is different #7746

Closed
lanzay opened this issue Sep 17, 2017 · 1 comment
Closed
Assignees

Comments

@lanzay
Copy link

lanzay commented Sep 17, 2017

OrientDB Version: 2.2.27

Java Version: NA

OS: NA

Studio version : 2.2

Expected behavior

Create right EDGE for traverse
UPDATE EDGE have NO "UPSERT" - it is not convenient

Actual behavior

create all items w/o error but not right created EDGE
1 to 3 - not right EDGE (look like all right)
How do it in one step?

Steps to reproduce

CREATE CLASS users IF NOT EXISTS EXTENDS V
CREATE CLASS e_frend IF NOT EXISTS EXTENDS E
UPDATE users CONTENT {"ID": 1, "Name":"Name1"} UPSERT WHERE ID = 1
UPDATE users CONTENT {"ID": 2, "Name":"Name2"} UPSERT WHERE ID = 2
UPDATE users CONTENT {"ID": 3, "Name":"Name3"} UPSERT WHERE ID = 3

CREATE EDGE e_frend FROM (SELECT FROM users WHERE ID = 1) TO (SELECT FROM users WHERE ID = 2)

UPDATE e_frend SET out = (SELECT FROM users WHERE ID = 1), in = (SELECT FROM users WHERE ID = 3) UPSERT WHERE out.ID = 1 and in.ID = 3

@luigidellaquila
Copy link
Member

Hi @lanzay

The UPDATE/UPSERT works at document level, so it doesn't create the connections from the vertices. Using it, you will have a broken graph.
Unfortunately there is no CREATE EDGE with UPSERT yet, we have an open issue for this: #4436

Thanks

Luigi

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

No branches or pull requests

2 participants