节点已经存在。
我尝试通过展开来添加边缘,但我的函数importBuyConnectionIntoNeo4j
不起作用,
有人可以帮助我吗?
数据结构:
class Connection
{
private string type;
public string Type
{
get { return type; }
set { type = value; }
}
private string source;
public string Source
{
get { return source; }
set { source = value; }
}
private string target;
public string Target
{
get { return target; }
set { target = value; }
}
}
class BuyConnection:Connection
{
}
myFunction的:
public void importBuyConnectionIntoNeo4j(List<BuyConnection> connectionList)
{
GraphClient client = createConnectionToNeo4j();
client.Cypher
.Unwind(connectionList, "connection")
.Match("(source:Person),(target:Vegetable)")
.Where("source.Name=connection.Source AND target.Type=connection.Target")
.Create("(source)-[:Buy]->(target)")
.ExecuteWithoutResults();
}
答案 0 :(得分:0)
我认为问题在于您的.where
文字:
.Where("source.Name=connection.Source AND target.Type=connection.Target")
是正确的Source
和Target
吗?