1
任何人都可以建議我應該如何更改我的代碼(這是基於3.0開發人員手冊中的第3.5.1.4.2節)。我正試圖通過螺栓中的一個查詢創建多個節點。Neo4j + bolt + c#;如何通過傳遞地圖作爲參數通過一個查詢創建多個節點
using (var driver = GraphDatabase.Driver(Neo4jCredentials.Instance, AuthTokens.Basic(Neo4jCredentials.Username, Neo4jCredentials.Password)))
using (var session = driver.Session())
{
string query = "UNWIND { props } AS map CREATE(n) SET n = map";
Dictionary<string, object> myParameter = new Dictionary<string, object>();
myParameter.Add("props", "{\"props\":[{\"name\":\"Andres\",\"position\":\"Developer\"},{\"name\":\"Michael\",\"position\":\"Developer\"}]}");
return session.Run(query, myParameter);
}
我得到的錯誤是:
{"Expected map to be a map, but it was :`{\"props\":[{\"name\":\"Andres\",\"position\":\"Developer\"},{\"name\":\"Michael\",\"position\":\"Developer\"}]}`"}
在此先感謝我的朋友們瞭解到...