Update edge with Upsert
See original GitHub issueOrientDB Version: v3.0.3
Java Version: 8
OS: macOS
Expected behavior
Update edge with upsert should cover case like:
NodeObj
vertex has unique index on qName
.
ImpactEdge
vertex has unique index on edgeId
.
Running commands
CREATE VERTEX NodeObj CONTENT {"tD":1,"qName":"1.101.4.2881","cT":1531588634559} ;
CREATE VERTEX NodeObj CONTENT {"tD":1,"qName":"1.101.4.3620","cT":1531588634559} ;
UPDATE Edge ImpactEdge SET out = ( SELECT FROM NodeObj where qName='1.101.4.2881') , in = ( SELECT FROM NodeObj where qName='1.101.4.3620') , edgeId= '1.101.4.2881_1.101.4.3620_9223372036854775807' UPSERT WHERE edgeId = '1.101.4.2881_1.101.4.3620_9223372036854775807' .
should create a edge between two vertices if doesn’t exists and update IN
and OUT
fields on the vertices as well.
Actual behavior
It creates the edge and sets the @rid
properly within the edge but its not updating the IN
and OUT
fields on the vertices and thus breaks the graph.
Steps to reproduce
Running the above commands should re-create the scenario.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:9 (3 by maintainers)
Top Results From Across the Web
SQL - Update Edge · OrientDB Manual
UPSERT Updates a record if it exists or inserts a new record if it doesn't. This avoids the need to execute two commands,...
Read more >Can we UPSERT an EDGE in orientdb? - Stack Overflow
It works this way cos “The UPDATE/UPSERT works at document level, so it doesn't create the connections from the vertices. Using it, you...
Read more >UPSERT EDGE - Nebula Graph Database Manual
The UPSERT statement is a combination of UPDATE and INSERT . You can use UPSERT EDGE to update the properties of an edge...
Read more >Making efficient upserts using Gremlin - Amazon Neptune
Efficient upserts can make a significant difference in the performance of Gremlin queries. An upsert (or conditional insert) reuses a vertex or edge...
Read more >Use Upsert to Create or Update a record (Microsoft Dataverse)
When loading data into Dataverse from an external system, you may not know if a record already exists in Dataverse and should be...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Please look into this issue as well it has become a major bottleneck for us. https://github.com/orientechnologies/orientdb/issues/8427 thanks!
I not try, but found it: http://orientdb.com/docs/3.1.x/console/Console-Command-Repair-Database.html Maybe can help. Not sure.