以下测试用例(假设密码正确)
<?php
require_once "vendor/autoload.php";
use GraphAware\Neo4j\Client\ClientBuilder;
$client = ClientBuilder :: create() -> addConnection("default", "http://neo4j:Password@localhost:7474") -> build();
$query = "MATCH (u:User)
RETURN u";
$result = $client -> run($query);
$user = $result -> firstRecord() -> values()[0];
?>
Run Code Online (Sandbox Code Playgroud)
给我以下错误:
PHP Fatal error: Uncaught GuzzleHttp\\Exception\\ClientException: Client error: `POST http://neo4j:***@localhost:7474/db/data/transaction/commit` resulted in a `400 Bad Content-Type header value: ''` response in /var/www/html/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
Stack trace:
#0 /var/www/html/vendor/guzzlehttp/guzzle/src/Middleware.php(66): GuzzleHttp\\Exception\\RequestException::create(Object(GuzzleHttp\\Psr7\\Request), Object(GuzzleHttp\\Psr7\\Response))
#1 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\\Middleware::GuzzleHttp\\{closure}(Object(GuzzleHttp\\Psr7\\Response))
#2 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\\Promise\\Promise::callHandler(1, Object(GuzzleHttp\\Psr7\\Response), Array)
#3 /var/www/html/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\\Promise\\Promise::GuzzleHttp\\Promise\\{closure}()
#4 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(246): GuzzleHttp\\Promise\\TaskQueue->run(true)
#5 /var/www/html/vendor/guzzlehttp/ in …Run Code Online (Sandbox Code Playgroud) 我有一个cypher查询,产生以下结果:
A 1
A 2
A 3
B 1
B 2
Run Code Online (Sandbox Code Playgroud)
我想将第一个属性的相同值组合起来并总结它们,结果将是:
A 6
B 3
Run Code Online (Sandbox Code Playgroud)