Created
October 28, 2021 10:01
-
-
Save Hkazanci93/853d06eb51b04db09911058e4040e0fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MATCH (src:Station{id: $src}) | |
MATCH (dst:Station{id: $dst}) | |
MERGE (src)-[t:Trip]->(dst) | |
ON CREATE | |
SET t.counts = [n in range(0, 167) | CASE WHEN n = $hour THEN 1 ELSE 0 END] | |
ON MATCH | |
SET t.counts = t.counts[0..$hour] + [t.counts[$hour]+1] + t.counts[($hour+1)..168] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment