Last active
December 11, 2015 18:58
-
-
Save mhluongo/4645421 to your computer and use it in GitHub Desktop.
A quick bit of Cypher demonstrating how you can change the default null-ordering in ORDER BY. Note that the trick is in the null predicate and STR cast.
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
START n=node({startId}) | |
MATCH (n)-[?:DID]->(thing) | |
WITH thing, (thing.year? = null) AS year_is_null | |
WITH thing, STR(year_is_null) as null_year | |
ORDER BY null_year, thing.year? DESC | |
RETURN thing, thing.year? as year |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment