return 路径而不是节点的 neoj 存储库方法的结果是什么?

What will be the result of the neoj repository method that return path, and not a node?

我在一篇 airpair 文章中发现了这个例子,基本上它创建了一个密码查询,return 一个路径而不是节点或关系,所以我想知道 return 对象中会写什么.

 @Query("match p=(i:Ingredient {name:{0}})-[r:PAIRS_WITH*0..3]-(i2)-[:HAS_CATEGORY]->(cat) return p;")
    Iterable<Map<String, Object>> getFlavorPaths(String ingredientName);

您将获得一组路径,其中每条路径都是节点和关系的列表,而每个节点或关系都是表示属性的 Map。来源表明返回的内容:https://github.com/luanne/flavorwocky/blob/sdn/src/main/java/com/flavorwocky/service/PairingServiceImpl.java#L56

请注意,这仅在 Spring Data Neo4j 4.0.0.RELEASE 中有效。 SDN 4.1 不支持返回路径,因为现在自定义查询中返回的节点和关系可以映射到域实体。有关 SDN 4.1.1 等效项,请参阅 https://github.com/luanne/flavorwocky/blob/sdn-4.1/src/main/java/com/flavorwocky/repository/IngredientRepository.java#L19