On Wed, Aug 24, 2011 at 5:44 PM, Aseem Kishore <[email protected]>wrote:
> Here's my use case: I want to show my friends' "comments" and "likes". > > For comments, I can do e.g. "(friend) -[:WROTE]-> (comment)", and for > likes, > I can do e.g. "(friend) -[:LIKES]-> (object)", but is there a way I can > combine both these matches into one Cypher query? I know I can put multiple > match clauses, but it's my understanding that that's an AND, not an OR. > > For this particular case, since the length/shape of the path is the same > for > both cases, being able to specify multiple choices for relationship type > would work here, e.g. "(friend) -[:WROTE,:LIKES]-> (object)", where the > returned object could potentially be a comment. > What you can do if you want to OR relationship types is this: MATCH friend -[r]-> object WHERE r~TYPE = "WROTE" or r~TYPE = "LIKES" I've been considering adding something like what you suggest. It's a good idea - it's mostly a matter of picking the most important features first right not. Thanks for your feedback - much appreciated! Andrés _______________________________________________ Neo4j mailing list [email protected] https://lists.neo4j.org/mailman/listinfo/user

