通过REST发送带有LOAD CSV的Cypher脚本不适用于我 [英] Sending Cypher script with LOAD CSV via REST isn't working for me

查看:264
本文介绍了通过REST发送带有LOAD CSV的Cypher脚本不适用于我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试通过REST发送此cypher脚本:

I'm trying to send this cypher script via REST:

{"statements":[{"statement":"LOAD CSV WITH HEADERS FROM \"http://localhost:9000/api/csv/Countries/csv\" as csvLine
MERGE (c:Country { Code: csvLine.Code })

RETURN c","resultDataContents":["row"],"includeStats":true}]}

但我回来了:

{"results":[],"errors":[]}

如果我在Neo4J浏览器中使用相同的嵌入式查询,以下工作正常:

If I the same embedded query in the Neo4J browser it works fine. The following works fine:

{"statements":[{"statement":"CREATE n RETURN n","resultDataContents":["row"],"includeStats":true}]}

p>

I get back:

{"results":[{"columns":["n"],"data":[{"row":[{}]}],"stats":{"contains_updates":true,"nodes_created":1,"nodes_deleted":0,"properties_set":0,"relationships_created":0,"relationship_deleted":0,"labels_added":0,"labels_removed":0,"indexes_added":0,"indexes_removed":0,"constraints_added":0,"constraints_removed":0}}],"errors":[]}

任何人都知道我在做什么错了?
如果它不工作,为什么我会得到空的错误?

Anyone have any idea what I am doing wrong? Why would I get the empty errors if it's not working?

推荐答案

虽然我明显有一些问题匹配RETURN部分我的查询的格式REST期望的结果,真正的问题是JSON包中的语句不能走多行。这解释了我所有的症状。谢谢你的帮助,肯尼! :)

While I clearly had some issues matching the RETURN portion of my query with the format REST was expecting the results in, the real problem was that the statements in the JSON package cannot go on multiple lines. Which explains all the symptoms I was having. THanks for your help, Kenny! :)

这篇关于通过REST发送带有LOAD CSV的Cypher脚本不适用于我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆