简体   繁体   English

neo4j禁用“可发现性”(php示例)

[英]neo4j disable “discoverability” (php example)

I am doing several request using raw curl/php to the REST API, the api returns a bunch of urls...I just want the data! 我正在使用原始curl / php对REST API进行几个请求,该api返回了一堆网址...我只想要数据! Is there a way to do disable that behavior? 有没有办法禁用该行为?

Server is returning about 2.8MB for each request. 服务器为每个请求返回大约2.8MB。

Ex: $request 例如:$ request

{"query" : "START user = node(1) MATCH (user)<-[:TEST_PYRAMID_15x15x15_NOT_UNIQUE_II]-(friend)  return distinct friend limit 1","params" : { }}

PHP 的PHP

$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json","Accept:  application/json; charset=UTF-8","Content-length: ".strlen($request)));
curl_setopt($ch,CURLOPT_POSTFIELDS, $request);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
curl_close($ch);

Response: 响应:

 {
  "columns" : [ "friend" ],
  "data" : [ [ {
    "paged_traverse" : "http://localhost:7474/db/data/node/366/paged/traverse/{returnType}{?pageSize,leaseTime}",
    "outgoing_relationships" : "http://localhost:7474/db/data/node/366/relationships/out",
    "data" : {
      "fbfullname" : "NAME",
      "fbid" : "6969696969696969"
    },
    "all_typed_relationships" : "http://localhost:7474/db/data/node/366/relationships/all/{-list|&|types}",
    "traverse" : "http://localhost:7474/db/data/node/366/traverse/{returnType}",
    "self" : "http://localhost:7474/db/data/node/366",
    "all_relationships" : "http://localhost:7474/db/data/node/366/relationships/all",
    "property" : "http://localhost:7474/db/data/node/366/properties/{key}",
    "outgoing_typed_relationships" : "http://localhost:7474/db/data/node/366/relationships/out/{-list|&|types}",
    "properties" : "http://localhost:7474/db/data/node/366/properties",
    "incoming_relationships" : "http://localhost:7474/db/data/node/366/relationships/in",
    "incoming_typed_relationships" : "http://localhost:7474/db/data/node/366/relationships/in/{-list|&|types}",
    "extensions" : {
    },
    "create_relationship" : "http://localhost:7474/db/data/node/366/relationships"
  } ] ]
}

I know if I ask for a particular property, neo4j will return only that part, but I do not know beforehand the properties. 我知道如果我要特定属性,neo4j将仅返回该部分,但我事先不知道这些属性。 "Ex return friend.fbid" “前返回friend.fbid”

If you return nodes/rels/paths, the REST API will return the full representation. 如果返回节点/关系/路径,则REST API将返回完整的表示形式。 We are thinking about a function in Cypher to return the properties on a node/rel though. 我们正在考虑使用Cypher中的函数来返回节点/ rel上的属性。

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

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