1
使用V2 py2neo我可以把这个__init__.py
设置Neo4j的唯一性约束在py2neo V3
graph.cypher.execute("CREATE CONSTRAINT ON (n:User) ASSERT n.username IS UNIQUE")
为什么V3 py2neo
graph.run("CREATE CONSTRAINT ON (n:User) ASSERT n.username IS UNIQUE")
失败,此错误?
TypeError: unbound method run() must be called with Graph instance as first argument (got str instance instead)
你如何声明'graph'变量? –
哇!你从错误信息中发现了我的错字...我忘了图中的括号= Graph()你怎么做到的? – user1613312
我想你回答了我的问题,但我不能评论你的评分? – user1613312