question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update edge with Upsert

See original GitHub issue

OrientDB 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:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
gtadudepscommented, Jul 27, 2018

Please look into this issue as well it has become a major bottleneck for us. https://github.com/orientechnologies/orientdb/issues/8427 thanks!

0reactions
AndreiSorokacommented, Feb 18, 2019

I not try, but found it: http://orientdb.com/docs/3.1.x/console/Console-Command-Repair-Database.html Maybe can help. Not sure.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found