Reputation: 567
g.mergeE(
new Map([
[T.label, edgeLabel],
[Direction.out, `src_${id}`],
[Direction.in, `dest_${id}`],
]),
)
.option(
onCreate,
new Map([
['created', Date.now()],
['weight', weight],
]),
)
.option(
onMatch,
new Map([
['updated', Date.now()],
['weight', __.values('weight').math('_ + ' + weight)], // Increment weight using math
]),
)
.elementMap()
.toList()
.then((data) => console.log(data))
Im trying to run this mergeE in type script, and keep getting errors. Is there a way to get the value of existing edge property(if exist the property always exist) and use it for the calculation of the new value of it
Upvotes: 1
Views: 17