Sukaant, your first query which works: START n=node(*), m=node(2) MATCH p=(m)-[r?:FOLLOWED_BY|CREATED_ BY|FOLLOW_PENDING*]->(n)
The second which does not work: START m=node(2) MATCH (m)-[r]->(n) OPTIONAL MATCH p=(m)-[r:FOLLOWED_BY|CREATED_BY|FOLLOW_PENDING]->(n) WITH r, n WHERE has(n.timeBoardName) AND n.timeBoardName =~ "(?i).*" RETURN r, n You have an extra line: START m=node(2) *MATCH (m)-[r]->(n) *//forces m to have at least one outgoing relation OPTIONAL MATCH p=(m)-[r:FOLLOWED_BY|CREATED_BY|FOLLOW_PENDING]->(n) WITH r, n WHERE has(n.timeBoardName) AND n.timeBoardName =~ "(?i).*" RETURN r, n -Luanne On Mon, Jan 6, 2014 at 11:35 AM, Sukaant Chaudhary < [email protected]> wrote: > Using the following query I'm getting all the nodes having following > relation in OPTIONAL MATCH, but I also want all those, which are not having > relation with (m): > > START m=node(2) > MATCH (m)-[r]->(n) > OPTIONAL MATCH p=(m)-[r:FOLLOWED_BY|CREATED_BY|FOLLOW_PENDING]->(n) > WITH r, n > WHERE has(n.timeBoardName) AND n.timeBoardName =~ "(?i).*" > RETURN r, n; > > -Sukaant Chaudhary > > > On Mon, Jan 6, 2014 at 11:18 AM, Sukaant Chaudhary < > [email protected]> wrote: > >> I was using following query in the earlier version and it was working >> fine: >> >> START n=node(*), m=node(2) >> MATCH p=(m)-[r?:FOLLOWED_BY|CREATED_BY|FOLLOW_PENDING*]->(n) >> WHERE has(n.timeBoardName) AND n.timeBoardName =~ "(?i)exp.*" >> RETURN r, n; >> >> -Sukaant Chaudhary >> >> >> On Mon, Jan 6, 2014 at 10:34 AM, Sukaant Chaudhary < >> [email protected]> wrote: >> >>> Hi, >>> Please help me to solve this query, It was working fine but again it >>> stopped working because of *n = node(*)* >>> >>> START m=node(2), *n = node(*)* OPTIONAL MATCH >>> p=(m)-[r:FOLLOWED_BY|CREATED_BY|FOLLOW_PENDING]->(n) WITH r, n WHERE >>> has(n.timeBoardName) AND n.timeBoardName =~ "(?i)exp.*" RETURN r, n; >>> >>> I'm getting the following exception: >>> >>> NotFoundException: NodeImpl#10704 not found. This can be because someone >>> else deleted this entity while we were trying to read properties from it, >>> or because of concurrent modification of other properties on this entity. >>> The problem should be temporary. >>> >>> -Sukaant Chaudhary >>> >> >> > -- > 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/groups/opt_out.
