rpuga
rpuga
Explore posts from servers
ATApache TinkerPop
Created by rpuga on 3/23/2024 in #questions
mergeE(): increment counter on match
Hi, is there an easy way to increment an existing edge property based on its current value using mergeE() in one single query? (e.g., counter += 1) Something similar to this:
g.mergeE([(T.label):'called', (from): person1, (to):person2]).
option(Merge.onCreate,['num_calls': 1]).
option(Merge.onMatch,['num_calls': X+1])
g.mergeE([(T.label):'called', (from): person1, (to):person2]).
option(Merge.onCreate,['num_calls': 1]).
option(Merge.onMatch,['num_calls': X+1])
where X is the current value of edge propery num_calls.
16 replies