Skip to content

Instantly share code, notes, and snippets.

@skynet
Forked from jadell/mutual.php
Created June 11, 2013 04:40
Show Gist options
  • Save skynet/5754507 to your computer and use it in GitHub Desktop.
Save skynet/5754507 to your computer and use it in GitHub Desktop.
<?php
$client = new Everyman\Neo4j\Client();
$queryString =
"START firstPerson=node({firstId}), secondPerson=node({secondId}) " .
"MATCH firstPerson -[:FRIEND]-> mutualFriend <-[:FRIEND]- secondPerson" .
"RETURN mutualFriend";
$params = array(
"firstId" => 123,
"secondId" => 456
);
$query = new Everyman\Neo4j\Cypher\Query($client, $queryString, $params);
$results = $query->getResultSet();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment