【问题标题】:Neo4jClient - Create index from within Neo4jClient?Neo4jClient - 从 Neo4jClient 中创建索引?
【发布时间】:2014-02-04 15:42:21
【问题描述】:

有没有办法从 Neo4jClient 中创建索引?我做了一个原始查询,但不认为这是最好的选择。我这样做的原因是为了测试目的,我需要删除/重新创建数据库来测试不同设计的性能。

【问题讨论】:

    标签: neo4jclient


    【解决方案1】:

    你可以做如下索引:

    graphClient.Cypher
        .Create("INDEX ON :Label(Property)")
        .ExecuteWithoutResults();
    

    以及以下约束:

    graphClient.Cypher
        .CreateUniqueConstraint("identity", "property")
        .ExecuteWithoutResults();
    

    (原自How to Create a Node with Neo4jClient in Neo4j v2?

    【讨论】:

    • 谢谢!没想过使用相同的 Create() 方法。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多