I have several nodes in my database that are not connected to any other nodes and I don’t need them in the database. I have gone through this guide but it does not mention anything regarding deleting all single nodes. Is there any way I could delete all nodes that are not connected to any other nodes?
Example of single nodes in my database.
>Solution :
Find any node labels and check if there is no connected nodes, then delete them
MATCH (n)
WHERE size((n)--())=0
DELETE (n)
