Skip to content

How can I avoid duplicate insertion of edges #1193

Answered by michaelvlach
pinghe asked this question in Q&A
Discussion options

You must be logged in to vote

Your code is correct but there is a bug in the server (#1192) that causes the error. Firstly the form search().from().to() does a path search meaning it will return only a single path, not all possible paths. It will still get a job done in this case because even if there is a single result the insert will just update that and if there is no path it will create them all. But it is worth noting it all the same.

Secondly there is a bug in that replacing the ":1" does not currently work within ids(). I have opened #1192 and will get it fixed asap. As a workaround until the fix you can use:

QueryBuilder.search()
      .from("root")
      .where()
      .edge()
      .and()
      .distance(Cou…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by pinghe
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants