neo4j-4-laravel icon indicating copy to clipboard operation
neo4j-4-laravel copied to clipboard

How to run a cypher query?

Open krishnashetty0 opened this issue 10 years ago • 3 comments

Could you please show me running a cypher query using your neo4j-4-laravel?

krishnashetty0 avatar Jun 25 '14 19:06 krishnashetty0

Ref: https://github.com/jadell/neo4jphp/wiki/Cypher-and-gremlin-queries Ex: $client = new Everyman\Neo4j\Client(); $queryString = "START n=node(1) MATCH (n)<-[:KNOWS]-(x)-[:HAS]->() RETURN x";

$query = new Everyman\Neo4j\Cypher\Query($client, queryString); $result = $query->getResultSet();

krishnashetty0 avatar Jun 29 '14 03:06 krishnashetty0

I would love to know the answer to this question.

And the option of creating a new $client to run the query doesn't seem to be the best solution.

cleanunicorn avatar Jan 01 '15 20:01 cleanunicorn

you can get the client using getFacadeRoot

$neo4j = \Artdarek\Neo4j\Facades\Neo4j::getFacadeRoot();
$query = new Everyman\Neo4j\Cypher\Query($neo4j, 'MATCH (n) RETURN n;');

ashleydw avatar Jan 14 '15 08:01 ashleydw