簡體   English   中英

如何列出 <string> 通過Neo4jClient訪問Neo4j?

[英]How to a list<string> to Neo4j Through Neo4jClient?

我正在嘗試使用Neo4jClient將字符串列表發送到Neo4j,以在FOREACH密碼循環中使用。 我面臨的問題是,該程序不是為每個字符串創建不同的節點,而是僅創建一個節點,並將屬性Name設置為完整的逗號分隔列表。

我正在使用的代碼:

GraphClient graphClient = new GraphClient(new Uri("http://neo4j:a@localhost:7474/db/data"));
        graphClient.Connect();
        graphClient.Cypher
          .With("[{listTags}] AS T1")
          .ForEach("( n in T1| Merge (p: NPT {Name: n})")
          .OnCreate().Set("p.Mod =0")
          .OnMatch().Set("p.Mod = 0)")
           .WithParams(new { listTags = ResultString })
          .ExecuteWithoutResults();

我找到了解決方案。 我沒有使用.With("[{listTags}] AS T1")而是將其更改為.With("{listTags} AS T1") (放下方括號)。 現在可以使用。 不管怎么說,多謝拉。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM