Bry*_*yes 33 indexing neo4j cypher
我正在寻找类似于MySQL(SHOW INDEXES)的东西.我能够在Python中使用py2neo获取索引列表
graphDB = neo4j.GraphDatabaseService()
indexes = graphDB.get_indexes(neo4j.Node)
print(format(indexes))
Run Code Online (Sandbox Code Playgroud)
但我想知道是否有办法在Cypher做类似的事情.
jja*_*erg 53
还没.在Neo4j 2.0中引入了更多的密码友好索引,您可以发出一些DDL命令来创建和删除索引和约束,但是从2.01开始就是这样(参见文档).在1.9中,您无法使用cypher定义该类型的模式.
-
例如,在密码之外有许多方法
在neo4j-shell
你可以
index --indexes
schema
schema ls -l :YourLabel
在neo4j-browser
你可以
:schema
:schema ls -l :YourLabel
大多数允许您执行密码查询的API也将提供查询模式的方法,例如
GraphDatabaseService.schema().getConstraints()
和.getIndexes()
标签架构GraphDatabaseService.index().nodeIndexNames()
和.relationshipIndexNames()
遗留指数/db/data/schema/
基于标签的模式的端点/db/data/index/node/
与/db/data/index/relationship/
对传统指数小智 35
neo4j 3.1现在支持这个作为内置程序,你可以从Cypher CALL:
CALL db.indexes();
Run Code Online (Sandbox Code Playgroud)
http://neo4j.com/docs/operations-manual/3.1/reference/procedures/
Roc*_*ang 14
CALL db.indexes();
Run Code Online (Sandbox Code Playgroud)
已被 4.2 中报告的新 SHOW INDEXES 弃用
SHOW INDEXES
Run Code Online (Sandbox Code Playgroud)