START r=rel(*) return distinct(type(r))
On Monday, November 25, 2013 2:41:31 AM UTC+5:30, Jacqui Read wrote: > > Is there a way to get it to return only distinct relationship types? > > On Friday, 30 August 2013 19:35:24 UTC+1, Michael Hunger wrote: >> >> then "r" is a collection and you can do: >> >> return extract(rel in r : type(rel)) as types >> >> >> Am 30.08.2013 um 19:56 schrieb Karl Grossner <[email protected]>: >> >> And how about when the query traverses more than one relationship type, >> e.g. [r*0..1] >> >> The error there is 'Expected r to be a relationship, but it was a >> collection' >> >> thanks! >> >> On Monday, August 13, 2012 5:45:16 AM UTC-7, Michael Hunger wrote: >>> >>> type(r) see >>> http://docs.neo4j.org/chunked/milestone/query-function.html#_scalar_functions<http://www.google.com/url?q=http%3A%2F%2Fdocs.neo4j.org%2Fchunked%2Fmilestone%2Fquery-function.html%23_scalar_functions&sa=D&sntz=1&usg=AFQjCNEnN4k7FH7wE6ke72P3dF06q8g3JQ> >>> >>> Michael >>> >>> Am 13.08.2012 um 14:24 schrieb Murat: >>> >>> In a Cypher query I want to return just the type of the relationship, >>> and not the whole relationship object? How do I express that? I tried out >>> the property syntax as below without success. >>> >>> START n=node(1) >>> MATCH n-[r]->b RETURN >>> n.name<http://www.google.com/url?q=http%3A%2F%2Fn.name%2F&sa=D&sntz=1&usg=AFQjCNHUdH6df6UT9smHH-LJPYMNtu9epQ>, >>> >>> r.*type*, >>> b.name<http://www.google.com/url?q=http%3A%2F%2Fb.name%2F&sa=D&sntz=1&usg=AFQjCNHloW8pFFFUbjT9OluTCIfC4b7SSg> >>> >>> thanks. >>> >>> >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Neo4j" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
