不能通过REST的形式来创建Node
发布于 6 年前 作者 wlbyml 1952 次浏览 来自 问答

https://spring.io/guides/gs/accessing-neo4j-data-rest/ 按照上述链接用Spring-boot写的一个demo 只有一个启动类,一个实体和一个接口,对应都没问题,用http的post请求也返回201了,但是在7474的客户端怎么都查不到插入的记录。 确认过很多次,数据库实例是一个,但是就是查询不到之前插入的记录 请求

curl -i -X POST -H “Content-Type:application/json” -d ‘{ “name” : “testAsset”, “os” : “testssss”}’ http://192.168.10.42:8080/Asset

返回结果 HTTP/1.1 201 Location: http://192.168.10.42:8080/Asset/0 Content-Type: application/hal+json;charset=UTF-8 Transfer-Encoding: chunked Date: Tue, 15 May 2018 07:31:01 GMT { “name” : “testAsset”, “des” : null, “hostName” : null, “mac” : null, “os” : “testssss”, "_links" : { “self” : { “href” : “http://192.168.10.42:8080/Asset/0” }, “asset” : { “href” : “http://192.168.10.42:8080/Asset/0” } }

打出的日志: Request: UNWIND {rows} as row MATCH (n) WHERE ID(n)=row.nodeId SET n:Asset SET n += row.props RETURN row.nodeId as ref, ID(n) as id, {type} as type with params {type=node, rows=[{nodeId=0, props={hostName=null, des=null, os=testssss, name=testAsset, mac=null}}]}

麻烦大神们集思广益,帮帮忙~

回到顶部