Skip to content

Instantly share code, notes, and snippets.

@taseroth
Created July 19, 2021 10:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taseroth/a385ff5ef2022198c9f690b2f3a43c23 to your computer and use it in GitHub Desktop.
Save taseroth/a385ff5ef2022198c9f690b2f3a43c23 to your computer and use it in GitHub Desktop.
data store overview
CALL db.labels() YIELD label
CALL apoc.cypher.run('MATCH (:`'+label+'`) RETURN count(*) as count',{}) YIELD value
RETURN "(:"+ label + ")" as type, apoc.number.format(value.count) as cnt order by value.count desc
UNION
CALL db.relationshipTypes() YIELD relationshipType as type
CALL apoc.cypher.run('MATCH ()-[:`'+type+'`]->() RETURN count(*) as count',{}) YIELD value
RETURN "[" + type + "]" as type, apoc.number.format(value.count) as cnt order by value.count desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment