简体   繁体   English

这个 Cypher 查询有什么问题?

[英]What is wrong with this Cypher query?

I am trying to send the following to Neo4j using the REST interface, specifically the method given in the 2.2.9 manual tutorial on using REST from Java, sendTransactional Cypher query.我正在尝试使用 REST 接口将以下内容发送到 Neo4j,特别是 2.2.9 手动教程中给出的关于使用 Java REST 的方法,sendTransactional Cypher 查询。 However, as you can see below, I keep on getting an error that doesn't seem to have much to do with the query itself.但是,正如您在下面看到的,我不断收到一个错误,该错误似乎与查询本身没有太大关系。

Any tips on how I can debug this?关于如何调试这个的任何提示?

CREATE (p:player { props }), "parameters" { 
     "props" : { 
          "screen_name" : "testone", 
          "email" : "test.one@gmail.com", 
          "rank" : "-12", 
          "password" : "testonepass", 
          "details" : "test one details", 
          "latitude" : "0.0", 
          "longitude" : "0.0", 
          "available" : "true", 
          "publish" : "true" }}
{"results":[],"errors":[{"code":"Neo.ClientError.Request.InvalidFormat","message":"Unable to deserialize request: Unexpected character ('p' (code 112)): was expecting comma to separate OBJECT entries\n at [Source: HttpInputOverHTTP@10401de; line: 1, column: 66]"}]}

Form the snippet you posted, it looks like the payload to the transactional endpoint is incomplete.从您发布的片段中,看起来事务端点的有效负载不完整。 You could try this statement in the browser.你可以在浏览器中试试这个语句。 I just copied your statement and formatted it so it could be posted to the browser.我刚刚复制了您的声明并对其进行了格式化,以便将其发布到浏览器中。 Then you can at least see it work.那么你至少可以看到它的工作。 Clearly the data is being posted and it seems it is just comes down to formatting.显然数据正在发布,似乎只是归结为格式。

:POST /db/data/transaction/commit {
"statements": [
    {
        "statement": "CREATE (p:player { props })",
        "parameters": 
            {
                "props" : { 
                    "screen_name" : "testone", 
                    "email" : "test.one@gmail.com", 
                    "rank" : "-12", 
                    "password" : "testonepass", 
                    "details" : "test one details", 
                    "latitude" : "0.0", 
                    "longitude" : "0.0", 
                    "available" : "true", 
                    "publish" : "true" }  
             }
        }
    ]
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM