动态获取Node Neo4j的属性

时间:2019-03-07 12:49:24

标签: spring-data-neo4j

这是我的Neo4jRepository方法

@Query("match (pofr:NODE) where pofr.param1= {param1} return pofr.{param2}, pofr.param3")
    List<Node> getPropertiesOfNode(@Param("param1") String param1, @Param("param2") String param2);

ExceptionLogs:

    Error executing Cypher; Code: Neo.ClientError.Statement.SyntaxError; Description: Invalid input '{': expected an identifier, whitespace, a function name or a property key name (line 1, column 64 (offset: 63))
"match (pofr:NODE) where pofr.param1 = {param1} return pofr.{param2}, pofr.param3"
                                                                ^; nested exception is org.neo4j.ogm.exception.CypherException: Error executing Cypher; Code: Neo.ClientError.Statement.SyntaxError; Description: Invalid input '{': expected an identifier, whitespace, a function name or a property key name (line 1, column 64 (offset: 63))

在尝试动态填充属性数据时遇到问题。我们还有其他方法可以实现这一目标吗?

1 个答案:

答案 0 :(得分:0)

由于Cypher在那些位置不支持占位符,因此很遗憾在Spring Data Neo4j中无法解决此问题。