I am not sure how to use mergeE and mergeV using gremlin_python
I am using janusgraph with cassandra for my project and I want to implement upsert functionality. For that I didn't find much resources, only this gist (https://gist.github.com/spmallette/5cd448f38d5dae832c67d890b576df31) . From that, I wrote certain code which does work. The code looks like this
In the edge, I don't want an "updated" thing to be there but if I keep the dictionary empty for the options, it throws the error. Let me know if I am doing it wrong or not. Should I place the values in the
.property()
or should I keep the changes in the options
?3 Replies
Hello @GojosEnsei what is the intended behaviour you are looking for if the edge exists already but you do not want to set the updated value to true?
Hey @Andrea , thanks for the follow up. Sorry, I was a bit busy but after some experimentation I was able to do this myself. Actually I wanted to upsert. But I was not able to. But I figured out how to do that exactly. The key is to have some value always in
on_match
and on_create
.Glad you found a workaround. Could you share what worked for you?