WilQu
WilQu

Reputation: 7393

How to repair OrientDB broken links from the java API?

I need to repair some broken links in my OrientDB database. Running REPAIR DATABASE --fix-links from the console works, but I would like to be able to run it from java (scala actually) code.

I tried to execute the REPAIR command as a query but it is not accepted. I also tried to "manually" repair the links by executing commands like

UPDATE Comment SET author = NULL WHERE (SELECT expand(author)) is NULL;

or

UPDATE Comment SET author = NULL WHERE (SELECT expand($parent.$current.author)) is NULL;

but they either trigger an error or have no effect.

How can I repair my broken links from the java API?

Upvotes: 2

Views: 144

Answers (1)

WilQu
WilQu

Reputation: 7393

I managed to remove the broken links by looking for a property that should be on the linked entity.

UPDATE Comment SET author = NULL WHERE author.id IS NULL;

Upvotes: 1

Related Questions