Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find a list of index using Cypher

Tags:

neo4j

cypher

I've created an INDEX using cypher for my :Person label, but I cannot find any way of printing out a list of indexes or constraints available to my Neo4j system.

Is this something that is doable via Cypher?

like image 647
Nicholas Avatar asked Dec 20 '13 21:12

Nicholas


2 Answers

As Eve pointed out, you can get labels by calling CALL.Labels(). To get indexes just do:

CALL db.indexes()

Also if you do CALL db. in your neo4j browser you will see all the functions available.

like image 54
Kevin Cohen Avatar answered Oct 14 '22 06:10

Kevin Cohen


(Applicable to neo4j version 2.3.1 or later)

To get indexes via REST use this:

curl http://localhost:7474/db/data/schema/index/

In the neo4j console you can run the :schema command to get all indexes & constraints.

Showing schema in neo4j console

like image 28
vstrom coder Avatar answered Oct 14 '22 05:10

vstrom coder