Gremlin python MergeV update properties
I'm working with gremlin python 3.7.1 and AWS Neptune 1.3.2.1, and I'm trying to update vertex properties with MergeV().option(OnMatch, {...}), however the behavior isn't what I expect, it should be a=b but appears to be a=[c.b] where c is the old value. Someone knows how to implement correctly this behavior with MergeV?
Solution
If I'm understanding your question correctly, I think what you are seeing is a result of Neptune defaulting to
If you want to use mergeV and enforce single cardinality for properties (overwrite existing values instead of appending), you can try a query like this:
set cardinality for properties. Essentially what that means, is if I start with a vertex with property("name", "Alice"), and I try to overwrite the property with property("name", "Bob") Neptune will instead add the new property to a set such that vertex.name = {"Alice", "Bob"}. I think this is what you are seeing this set cardinality behaviour when using MergeV().If you want to use mergeV and enforce single cardinality for properties (overwrite existing values instead of appending), you can try a query like this: