2

I'm converting the result of my query to a tree using the apoc.convert.toTree() procedure and then I filter the result to get only couple properties. However, in the resulting payload I get two properties _id and _type that I'm unable to remove.

this is my query where I' supposed to get only prefLabel and uri:

MATCH p=(n {uri:'https://enterprise.poolparty.biz/Taxo_test/11325'})-[:narrower*]->(m)
WHERE NOT ()-[:narrower]->(n)
WITH COLLECT(p) AS ps
call apoc.convert.toTree(ps, true, { nodes: {CategoryNode: ['prefLabel', 'uri']} }) yield value
RETURN value;

the result has the label and an id object:

{
                            "_type": "CategoryNode",
                            "narrower": [{
                                    "_type": "CategoryNode",
                                    "narrower": [
                                        {
                                            "_type": "CategoryNode",
                                            "_id": {
                                                "low": 2530,
                                                "high": 0
                                            },
                                            "uri": "https://enterprise.poolparty.biz/Taxo_test/13594",
                                            "prefLabel": "Haie artificielle"
                                        }
                                    ],
                                    "_id": {
                                        "low": 2528,
                                        "high": 0
                                    },
                                    "uri": "https://enterprise.poolparty.biz/Taxo_test/11325",
                                    "prefLabel": "Occultation plastique"
                                },
kyserslick
  • 591
  • 1
  • 10
  • 27
  • Which version of APOC are you using ? The definition of this procedure is `apoc.convert.toTree(paths :: LIST? OF PATH?, lowerCaseRels = true :: BOOLEAN?) :: (value :: MAP?)` – logisima May 24 '19 at 08:52
  • Hello @logisima, I'm using the latest apoc-3.5.0.3 – kyserslick May 24 '19 at 10:09

0 Answers0