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