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
如何将元素添加到列表的顶部Neo4j?_Neo4j_Cypher - Fatal编程技术网

如何将元素添加到列表的顶部Neo4j?

如何将元素添加到列表的顶部Neo4j?,neo4j,cypher,Neo4j,Cypher,我试图使用cypher将元素添加到neo4j中具有stringized对象的列表顶部,我可以使用以下查询将元素添加到末尾: MATCH (N) set N.existingArray=N.existingArray+'{"a":"5","b":"10"}'; 要在开始时添加,我尝试使用neo4j中的reverse函数首先反转数组: MATCH (N) SET N.existingArray=reverse(N.existingArray)+'{"a":"5","b":"10"}'; 但这给了

我试图使用cypher将元素添加到neo4j中具有stringized对象的列表顶部,我可以使用以下查询将元素添加到末尾:

MATCH (N) set N.existingArray=N.existingArray+'{"a":"5","b":"10"}';
要在开始时添加,我尝试使用neo4j中的reverse函数首先反转数组:

MATCH (N) SET N.existingArray=reverse(N.existingArray)+'{"a":"5","b":"10"}';
但这给了我一个错误:

Neo4jError: Expected a string or a list; consider converting it to a string with toString()
有人能帮我找到解决这个问题的办法吗


提前感谢

您应该能够在开头而不是结尾追加:

MATCH (N) 
SET N.existingArray = '{"a":"5","b":"10"}' + N.existingArray;