我正在尝试在py2neo中将文件作为参数传递,以使查询中的变量作为其他参数。而不是:cypher
from py2neo import Graph
graph = Graph(password = "*****")
def test(some_things):
result = graph.run(
"MATCH (movie:movies)"
"where movie.name =~ $name "
"RETURN movie",{"name":"(?i).*" + some_things+ ".*"})
return result
我想知道是否有这样的东西:
from py2neo import Graph
graph = Graph(password = "*****")
def test(some_things):
result = graph.run("some_cypher.cypher", some_things)
return result
其中可能是:some_cypher.cypher
MATCH (movie:movies) where movie.name =~ $name RETURN movie, ,{"name":"(?i).*" + ?+ ".*"}
在 python 文件中是要替换为 的参数。?some_things
狐的传说
喵喔喔
相关分类