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
Indexing Neo4j APOC触发器和关系属性的手动索引_Indexing_Neo4j_Cypher_Neo4j Apoc - Fatal编程技术网

Indexing Neo4j APOC触发器和关系属性的手动索引

Indexing Neo4j APOC触发器和关系属性的手动索引,indexing,neo4j,cypher,neo4j-apoc,Indexing,Neo4j,Cypher,Neo4j Apoc,我想设置Neo4j APOC触发器,将所有关系属性添加到手动索引中,如下所示: CALL apoc.trigger.add('HAS_VALUE_ON_INDEX',"UNWIND {createdRelationships} AS r MATCH (Decision)-[r:HAS_VALUE_ON]->(Characteristic) CALL apoc.index.addRelationship(r,['property_1','property_2']) RETURN count(

我想设置Neo4j APOC触发器,将所有关系属性添加到手动索引中,如下所示:

CALL apoc.trigger.add('HAS_VALUE_ON_INDEX',"UNWIND {createdRelationships} AS r MATCH (Decision)-[r:HAS_VALUE_ON]->(Characteristic) CALL apoc.index.addRelationship(r,['property_1','property_2']) RETURN count(*)", {phase:'after'})
问题是我不知道
关系属性的确切值集,因为我对Spring数据Neo4 5使用动态属性方法


是否可以更改此触发器声明,以便能够将
关系属性(现有的和将来将创建的)上的所有HAS\u VALUE\u添加到手动索引,而不是预配置的属性(如所述示例中的
['property\u 1','property\u 2']
)?

如果您事先不知道属性集,则可以使用函数将创建的关系的所有属性添加到索引中:

CALL apoc.trigger.add(
  'HAS_VALUE_ON_INDEX',
  'UNWIND {createdRelationships} AS r MATCH (Decision)-[r:HAS_VALUE_ON]->(Characteristic) 
   CALL apoc.index.addRelationship(r, keys(r)) RETURN count(*)',
   {phase:'after'}
)