2014-11-05 1 views
1

WHERE 조건에 대한 매개 변수를 전달하는 방법은 무엇입니까? 그것은 즉Cypher : WHERE IN에서 여러 매개 변수 전달

, 이것은 잘 작동 :

match (b:Book) where b.guid={guid} return b; 

을하지만, 방법이 쿼리에 대한 매개 변수로 여러 GUID를 통과 :

match (b:Book) where b.guid in [guid1,guid2,gid3] return b; 

내가 neo4jphp 클라이언트를 사용하고, 내 코드는 like :

$client = new Everyman\Neo4j\Client("neo4j server address", "7474"); 
$result = new Everyman\Neo4j\Cypher\Query($client, "match (b:Book) where b.guid={guid} return b", array('guid'=>$guid1)); 
$res = $result->getResultSet(); 

답변

1

ar ray를 매개 변수로 사용하는 쿼리는 다음과 같습니다.

match (b:Book) where b.guid in {myMap} return b; 


$client = new Everyman\Neo4j\Client("neo4j server address", "7474"); 
$result = new Everyman\Neo4j\Cypher\Query($client, "match (b:Book) where b.guid in {MyMap} return b", array('myMap'=> array($guid1, $guid2, $guid3))); 
$res = $result->getResultSet(); 
+0

감사합니다. 이것은 나를 위해 작동하지 않는 것 같습니다. 다시 확인하겠습니다. neo4j-community-2.1.5 –

+0

을 사용하고 있습니다.이 쿼리를 사용해보십시오. IN [{myMap}] –

+0

'IN {myList} '이 맞습니다. –