Open wey-gu opened 3 years ago
More discussion here: https://nebulagraph.slack.com/archives/CJNFUM7AR/p1654647502447089
My use case: Batch update edge/vertex properties allowing pipelining. For my particular use-case, I wish to set a flag for certain edges that meet certain traversal conditions
Something like: GO FROM "user1", "user2" OVER in_group WHERE dst(edge) != "group1" YIELD src(edge) AS src, dst(edge) AS dst, rank(edge) AS rank | UPDATE EDGE ON in_group $-.src -> $-.dst @ $-.rank SET is_active = false;
Currently I have to bring back the result of GO FROM ...
to the application level, then generate UPDATE EDGE
commands.
GO FROM ..
statement executes and the UPDATE EDGE
can happen.@MuYiYong
Could we add support on this?
This is a missing piece on updating data based on property conditions in Nebula Graph as we only have ready cypher support for now.
MERGE (keanu:Person {name: 'Keanu Reeves'})
ON CREATE
SET keanu.created = timestamp()
ON MATCH
SET keanu.lastSeen = timestamp()
RETURN keanu.name, keanu.created, keanu.lastSeen
this was requested today.
cc @MuYiYong
In the cypher query, a lookup followed by an update is allowed in the format of "match (v: vertice)where v.property 1== value1, set v.property2= value2.". I am looking forward to a similar functionality to be supported.
update: it seems the variable in UPDATE/INSERT is already supported, but just not supported in the VID field
(root@nebula) [(none)]> $var = YIELD "player999" AS vid;UPDATE VERTEX ON player $var.id SET age=1 YIELD age
[ERROR (-1004)]: SyntaxError: Variable is not supported in vid near `$var'
Fri, 26 May 2023 15:06:57 CST
Are you interested in this? @RAJVARDHAN2486
@wey-gu Yes I am interested , I am starting my work
这个功能有排期吗?
Hi @RAJVARDHAN2486 The new year's hacktoberfest for developers has started. If you're interested, you're welcome to join us.
Is your feature request related to a problem? Please describe.
Describe the solution you'd like Support this:
Describe alternatives you've considered Or so other expressions which make more sense than I wasn't aware of?
Additional context
https://discuss.nebula-graph.com.cn/t/topic/5911