Returning values from >1 function

11 views
Skip to first unread message

Jim Webber

unread,
Dec 31, 2011, 11:55:25 AM12/31/11
to ne...@googlegroups.com
Hi cypher folks,

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

Andres Taylor

unread,
Jan 1, 2012, 11:40:30 AM1/1/12
to ne...@googlegroups.com
Only the min function? What do you mean? What is the output, and what do you expect?

That seems like a very reasonable query. I don't understand the problem.

Andrés

Jim Webber

unread,
Jan 2, 2012, 10:28:02 AM1/2/12
to ne...@googlegroups.com
Hey Andres,

> 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

Reply all
Reply to author
Forward
0 new messages