簡體   English   中英

Neo4j查詢調試

[英]Neo4j query debugging on

我正在嘗試在可用的Scala代碼中修改現有的neo4j密碼查詢,但是當我嘗試在調試器中運行以下查詢時,它給我以下錯誤:查詢:

START  doc = node:entities(type = "document-link")
MATCH  category-[:category]-doc<-[:`document-link`]-project-[?:`iati-identifier`]-id
RETURN COALESCE(project.`iati-identifier`?, id.`iati-identifier`?) as id,
   doc.title!                                                  as title,
   COALESCE(doc.format?, "text/plain")                         as format,
   doc.url                                                     as url,
   COLLECT(COALESCE(category.category?, ""))                   as categories

我收到的錯誤問號不再用於可選模式-改用OPTIONAL MATCH(第2行,第64列)“ MATCH類別-[:category] ​​-doc <-[: document-link ] iati-identifier [?: iati-identifier ] -id“

我該如何重寫查詢,以便可以在調試器中運行該查詢,然后允許我將修改測試寫入新密碼。 另外,為什么調試器不願意接受我知道在主代碼庫中工作的代碼?

抱歉,想要附加圖像,但我沒有足夠的聲譽來發布圖像。

不確定您對調試器的含義,但是? 暫時尚不支持可選模式。 您正在使用哪個版本的Neo4j? 錯誤消息表明您使用的版本不支持? 因此您將不得不使用OPTIONAL MATCH重寫查詢。

看起來您的:iati-identifier關系是可選的,因此將其移動到OPTIONAL MATCH中,然后將其匹配,否則id為null。 同樣刪除所有? 來自return語句中的屬性-如果丟失,則它們將為null。

START  doc = node:entities(type = "document-link")
MATCH  category-[:category]-doc<-[:`document-link`]-project
OPTIONAL MATCH project-[:`iati-identifier`]-id
RETURN COALESCE(project.`iati-identifier`, id.`iati-identifier`) as id,
   doc.title                                                  as title,
   COALESCE(doc.format, "text/plain")                         as format,
   doc.url                                                    as url,
   COLLECT(COALESCE(category.category, ""))                   as categories

(未經測試的查詢)

暫無
暫無

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

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