Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Cypher Neo4J中向APOC发送参数_Neo4j_Cypher_Neo4j Apoc - Fatal编程技术网

在Cypher Neo4J中向APOC发送参数

在Cypher Neo4J中向APOC发送参数,neo4j,cypher,neo4j-apoc,Neo4j,Cypher,Neo4j Apoc,我需要在Neo4J Cypher请求中向APOC函数发送几个关系ID: PROFILE UNWIND $contexts as cons WITH cons CALL apoc.index.relationships('TO','context:cons') YIELD rel, start, end WITH DISTINCT rel, start, end WHERE rel.user='15229100-b20e-11e3-80d3-6150cb20a1b9' RETURN D

我需要在Neo4J Cypher请求中向APOC函数发送几个关系ID:

PROFILE UNWIND $contexts as cons 
WITH cons 
CALL apoc.index.relationships('TO','context:cons') 
YIELD rel, start, end 
WITH DISTINCT rel, start, end 
WHERE rel.user='15229100-b20e-11e3-80d3-6150cb20a1b9' 
RETURN DISTINCT start.uid AS source_id, start.name AS source_name, end.uid AS target_id, end.name AS target_name, rel.uid AS edge_id, rel.context AS context_id, rel.statement AS statement_id, rel.weight AS weight;
我的参数如下:

{
 "contexts": [
 "09a73400-20ab-11e9-a5b3-9fb3da66a7cb",
 "0113a5c0-1f8f-11e9-9ff3-8379606e6d34",
 "3fb1d040-1f85-11e9-964f-7dc221bb473c",
 "1d0d8ed0-1f85-11e9-964f-7dc221bb473c"
 ]
}
当我像你一样送他们的时候

 CALL apoc.index.relationships('TO','context:09a73400-20ab-11e9-a5b3-9fb3da66a7cb 0113a5c0-1f8f-11e9-9ff3-8379606e6d34 3fb1d040-1f85-11e9-964f-7dc221bb473c 1d0d8ed0-1f85-11e9-964f-7dc221bb473c')
它是有效的


如何重写我的上述请求,以便将ID传递到
APOC
函数中?

这是一个Lucene查询字符串,因此您必须构建它或将其作为参数发送:

WITH 'context:('+apoc.text.join($contexts,' ')+')' as query
WITH cons 
CALL apoc.index.relationships('TO',query) 
...