Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 883 Vote(s) - 3.51 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find neo4j nodes with more than one incoming relationship

#1
I'm trying to find all the nodes with more than one incoming relationship. Given this data:

a-[has]->b
a-[has]->c
d-[has]->b

So, I'm looking for a query that returns 'b', because it has more that one incoming.

This query is close. It returns 'a' and 'b', because they both have 2 relations:

match (n)--()
with n,count(*) as rel_cnt
where rel_cnt > 1
return n;

However, this query (the addition of '-->') doesn't return any and I don't know why:

match (n)-->()
with n,count(*) as rel_cnt
where rel_cnt > 1
return n;

Am I going about this all wrong?
Reply

#2
Does this work for you?

MATCH ()-[r:has]->(n)
WITH n, count® as rel_cnt
WHERE rel_cnt > 1
RETURN n;

I am assuming, perhaps incorrectly, that 'has' is the appropriate relationship type. If not, then try:

MATCH ()-[r]->(n)
WITH n, count® as rel_cnt
WHERE rel_cnt > 1
RETURN n;
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through