【发布时间】:2015-05-14 13:22:32
【问题描述】:
我正在尝试使用 Cypher 语句 将一些节点和边插入到 Neo4j 图中。执行查询后,我从服务器收到了一个不太有意义的scala.MatchError 响应。我在 版本 2.2.0 中使用 Neo4j。
这是我的 Cypher 查询(请注意,它最初是一个 更大的查询的一部分,但这是我缩小的范围):
CREATE (node55549aefd9aa7:Arg {prop_node55549aefd9aa7})
此查询的参数(JSON 表示法):
{
"prop_node55549aefd9aa7": {
"startLine": 48,
"endLine": 51,
"type": 1,
"byRef": false,
"variadic": false,
"name": "query",
"default": null,
"__node_id": "node55549aefd9aa7"
}
}
这是我得到的错误响应:
scala.MatchError: (default,null) (of class scala.Tuple2)
at org.neo4j.cypher.internal.compiler.v2_2.mutation.CreateNode$$anonfun$org$$$$c818f6fea869bbb25aedba7c5faae2d$$$$e$$fromAnyToLiteral$1$1.apply(CreateNode.scala:40)
at org.neo4j.cypher.internal.compiler.v2_2.mutation.CreateNode$$anonfun$org$$$$c818f6fea869bbb25aedba7c5faae2d$$$$e$$fromAnyToLiteral$1$1.apply(CreateNode.scala:40)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.Iterator$class.foreach(Iterator.scala:727)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
// Several dozen lines of stack trace omitted
我正在使用everyman/neo4jphp 库从我的 PHP 应用程序访问 Neo4j。不过,我怀疑这无关紧要,因为在命令行上使用简单的 cURL 调用直接与 REST API 对话时,该错误也是可重现的:
curl -D - \
--user neo4j:XXXX \
-H "content-type: application/json" \
-d'{"statements":[{"statement":"CREATE (node55549aefd9aa7:Arg {prop_node55549aefd9aa7})", "parameters": {"prop_node55549aefd9aa7": {"startLine": 48, "endLine": 51, "type": 1, "byRef": false, "variadic": false, "name": "query", "default": null, "__node_id": "node55549aefd9aa7"}}}]}' \
http://localhost:7474/db/data/transaction/commit
这个错误是什么意思,为什么我会得到它?
【问题讨论】: