更新时间:2022-08-15 11:58:16
在Neo4j 2.0之后为cypher语法增加了一些类似于DDL的语法,能够自己创建索引,约束等等。
有如下的方法可以查询到当前图数据库的索引数量:
neo4j-shell
neo4j-browser
大多数APIs都支持使用CQL查询,以下提供两种查询方案
public static void main(String[] args) { GraphDatabaseService graphDb = new GraphDatabaseFactory().newEmbeddedDatabase(new File("D:\\neo4j\\HelloWorld3")); Transaction beginTx = graphDb.beginTx(); System.out.println("constraint:" + graphDb.schema().getConstraints(DynamicLabel.label("Test"))); System.out.println("index:" + graphDb.schema().getIndexes(DynamicLabel.label("Test"))); beginTx.success(); }
以上文内容翻译自***:
图片部分是已经试验可以使用
教程结束,感谢阅读。
欢迎转载,但请注明本文链接,谢谢。
2016-03-30 20:41:44