Neo4j Cypher查询中的无效输入错误

huangapple go评论82阅读模式
英文:

Invalid input error in Neo4j cypher query

问题

在Neo4j Cypher查询中出现无效输入错误

MATCH (n:CriticalAsset) WHERE n.name STARTS WITH 'Highly Confidential Data Type' RETURN n

我收到了无效输入错误。字段和属性都是正确的。

下面的图片将帮助你了解节点的情况。

感谢你的帮助来找出错误。

错误消息供参考:

无效输入' ': 预期标识符字符、'.'、空格、'('、节点标签或关系类型、'['、'^'、'*'、'/'、'%'、'+'、'-'、'=~'、IN、STARTS、ENDS、CONTAINS、IS、'='、'!='、'<'、'>'、'<='、'>='、AND、XOR、OR、USE GRAPH、LOAD CSV、START、MATCH、UNWIND、MERGE、CREATE UNIQUE、CREATE、SET、DELETE、REMOVE、FOREACH、WITH、CALL、RETURN、UNION、';' 或输入结束 (第1行,第38列 (偏移量:37))
"MATCH (n:CriticalAssets) WHERE n.name contains 'Highly Confidential Data Type' RETURN n"
英文:

Invalid input error in Neo4j cypher query

MATCH (n:CriticalAsset) where n.name&#160;starts&#160;with&#160;&#39;Highly Confidential Data Type&#39; RETURN n

I am getting invalid input error.Fields and attributes are correct.
Neo4j Cypher查询中的无效输入错误

Below picture, will gives you an idea about the node
Neo4j Cypher查询中的无效输入错误

Appreciate your help to identify the mistake.

Error message for your reference:

Invalid input &#39; &#39;: expected an identifier character, &#39;.&#39;, whitespace, &#39;(&#39;, node labels or rel types, &#39;[&#39;, &#39;^&#39;, &#39;*&#39;, &#39;/&#39;, &#39;%&#39;, &#39;+&#39;, &#39;-&#39;, &quot;=~&quot;, IN, STARTS, ENDS, CONTAINS, IS, &#39;=&#39;, &quot;&lt;&gt;&quot;, &quot;!=&quot;, &#39;&lt;&#39;, &#39;&gt;&#39;, &quot;&lt;=&quot;, &quot;&gt;=&quot;, AND, XOR, OR, USE GRAPH, LOAD CSV, START, MATCH, UNWIND, MERGE, CREATE UNIQUE, CREATE, SET, DELETE, REMOVE, FOREACH, WITH, CALL, RETURN, UNION, &#39;;&#39; or end of input (line 1, column 38 (offset: 37))
&quot;MATCH (n:CriticalAssets) where n.name contains &#39;Highly Confidential Data Type&#39; RETURN n&quot;

答案1

得分: 1

有时问题与缩进有关。您尝试过手动输入Cypher查询吗?这可能有助于解决问题,因为您的语法和查询似乎是正确的。

英文:

Sometime the issue is related to indentation. Have you tried to input the cypher query manually, which might helps to solve as your syntax and query seems correct.

答案2

得分: 0

Put name within backticks

name 放在反引号内

MATCH (n:CriticalAsset) where n.name starts with 'Highly Confidential Data Type' RETURN n

在节点标签和属性中,反引号用于忽略特殊字符和空格。很可能 name 包含特殊字符或空格。可能需要检查是否意图如此。

英文:

Put name within backticks

MATCH (n:CriticalAsset) where n.`name` starts with &#39;Highly Confidential Data Type&#39; RETURN n

Backticks are used to ignore special characters and spaces in node labels and properties. It is likely that name has some special character or a space. It might be worth checking whether you intend name to be that way

huangapple
  • 本文由 发表于 2023年5月25日 22:48:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/76333590.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定