Is there a way to remove _id:{#low, #high} _type

Hello everyone,

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"
								},

Regrettably, this method isn't the best documented. I do not think it is possible to prevent then from being returned, but it may be possible to strip out those fields afterwards? Are you using one of the official neo4j drivers to run this as part of a larger application or are you just trying to export this directly from the browser?

Indeed I'm using neo4j driver on a Nodejs app to return result of tree from my API

The reason you're seeing this is because not all languages are able to use 64-bit numeric representations. Javascript can't do this, thus there's a need to represent Neo4j's 64-bit numerics in some other way that provides options for how to deal with it.

Please review the Javacript driver documentation on working with numeric values, that should give you some options.

1 Like