I'm adding to the Neo4j koans (https://github.com/jimwebber/neo4j-tutorial) and I'd like a query where the first and last Doctor Who regenerations are returned.
I guessed I could do something like this in Cypher:
start doctor = node:characters(character = 'Doctor')
match (doctor)<-[:PLAYED]-()-[regeneratedRelationship:REGENERATED_TO]->()
return min(regeneratedRelationship.year), max(regeneratedRelationship.year)
But that doesn't achieve what I want (seemingly only the min function is executed).
Any ideas?
Jim
> Only the min function? What do you mean? What is the output, and what do
> you expect?
I meant when I call dumpToString() on the result, only the row for the min function appears. It looks as if max is never called (ditto when I switch the ordering - max is called not min).
> That seems like a very reasonable query. I don't understand the problem.
The problem was that the reasonable query didn't work. And now I've just run it again and it does work.
Just ignore me...
Jim