How to find disconnected nodes on neo4j with Cypher?

I play with neo4j and noticed that all Cypher requests need a starting point in the START clause. I was wondering how to find all disabled nodes using Cypher?

thanks

+4
source share
3 answers

If all of your nodes are indexed (for example, using automatic indexing), you can use the index query as a starting point, and then find those nodes that do not have outgoing relationships.

 start n=node:node_auto_index("id:*") match n-[r?]->m where r is null return n 

Currently, I prefer to use:

 start n=node:node_auto_index("id:*") where not (n-->m) return n 
+7
source

I use something like this, but only when I use spring -data-neo4j:

  start n = node:__types__(className="com.app.entity.Model") // match, where... return n 

Hope this helps!

+2
source

You can not. Graphical global queries are not possible with today's Cypher.

-2
source

Source: https://habr.com/ru/post/1388472/


All Articles