Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apoc.convert.toTree include/exclude not working with multiple node labels #3997

Open
diogohartuiqdebarba opened this issue Mar 8, 2024 · 0 comments

Comments

@diogohartuiqdebarba
Copy link

I need to remove the "born" in the toTree result, but when there is more than one label like Person:AnotherLabel, this does not work, and the result continues with "born" prop.

apoc.convert.toTree documentation

Expected Behavior

Return without "born" prop in the result.

Actual Behavior

Return the "born" prop in the result.

How to Reproduce the Problem

CREATE (p1:Person:AnotherLabel {name:'p1', born: 1980})
CREATE (p2:Person:AnotherLabel {name:'p2', born: 1990})
CREATE (p3:Person:AnotherLabel {name:'p3', born: 2010})
CREATE (p2)-[:SON]->(p1)
CREATE (p3)-[:SON]->(p2)

image

MATCH path = (root)-[:SON*0..]->(p:Person)
WITH COLLECT(path) AS paths
CALL apoc.convert.toTree(paths, true, { nodes: { Person: ['-born'] } }) YIELD value
RETURN value AS people 

Versions

  • OS: Windows
  • Neo4j Browser version: 5.11.0
  • Neo4j Server version: 5.12.0 (enterprise)
  • Neo4j Browser Changelog
  • Build number: 219
  • Build date: 01/08/2023
  • Neo4j-Apoc: apoc-5.10.1-core.jar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Core issues (with trello core card)
Development

No branches or pull requests

1 participant