Cypher query to return boolean value

600 views
Skip to first unread message

Joe Smith

unread,
Jun 12, 2012, 11:15:08 PM6/12/12
to Neo4j
I would like to do something like this:

start n1=node(1), n2=node(2)
match n1-[r?:friend]-n2
return r is not null

so, when n1 and n2 are friends, the query returns true; otherwise
false. The query of cause failed. Any trick to get the query to return
a boolean value?

Thanks,
Joe

Peter Neubauer

unread,
Jun 12, 2012, 11:57:11 PM6/12/12
to ne...@googlegroups.com

Well,
I think this is the beginning of a feature - return data (primitives, nodes, relationships) that are computed and not part of the underlying data.

This would open the gates for read - views of the graph, higher order constructions and other cool stuff.

Need to think.

For the time being, looking for the query having a result or not gives the same effect for you?

/peter

Send from mobile.

Andres Taylor

unread,
Jun 13, 2012, 3:03:32 AM6/13/12
to ne...@googlegroups.com
Using predicates as boolean expressions is in the backlog already. Thanks for bumping it up in priority!

Andrés

Axel Morgner

unread,
Jun 13, 2012, 3:51:14 AM6/13/12
to ne...@googlegroups.com

I think this is the beginning of a feature - return data (primitives, nodes, relationships) that are computed and not part of the underlying data.

This would open the gates for read - views of the graph, higher order constructions and other cool stuff.

+1 !!

Joe Smith

unread,
Jun 13, 2012, 8:19:42 AM6/13/12
to Neo4j
Thanks all. For now, I will Pete's suggestion.

On Jun 13, 3:03 am, Andres Taylor <andres.tay...@neotechnology.com>
wrote:
Reply all
Reply to author
Forward
0 new messages