Skip to content

Instantly share code, notes, and snippets.

@jonpacker
Forked from peterneubauer/gist:8667135
Last active January 4, 2016 20:39
Show Gist options
  • Save jonpacker/8675460 to your computer and use it in GitHub Desktop.
Save jonpacker/8675460 to your computer and use it in GitHub Desktop.
[source,cypher]
----
CREATE (node:TestThing1)-[:rel1]->(node2)-[:rel2]->(node3)
----
== Working
[source,cypher]
----
MATCH (n:TestThing1)
OPTIONAL MATCH n-[:rel1]->x
SET x.updated = timestamp()
----
== Workaround
[source,cypher]
----
MATCH (n:TestThing1)
OPTIONAL MATCH n-[:rel2]->x
WITH n, collect(x) as x
FOREACH (node in x | SET node.updated = timestamp())
----
== Not working
[source,cypher]
----
MATCH (n:TestThing1)
OPTIONAL MATCH n-[:rel2]->x
SET x.updated = timestamp()
----
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment