Show datatype in neo4j browser?

Is there a way to show the datatypes in the neo4j browser?

If a property has a number, you can't see if it is a string or a number. Same with boolean, it just shows "PropertyName: true", and you have no idea if it is a boolean true or a string "true"

Something like "PropertyName [bool]: true" or "PropertyName [number]: 123" would be helpful.

Since Neo4j is a schema free database this could be challenging for a given property could actually have different datatypes for multiple nodes. For example creating 3 nodes as follows

neo4j> create (n:MPasadu {id:1});
0 rows available after 413 ms, consumed after another 0 ms
Added 1 nodes, Set 1 properties, Added 1 labels
neo4j> create (n:MPasadu {id:'true'});
0 rows available after 23 ms, consumed after another 0 ms
Added 1 nodes, Set 1 properties, Added 1 labels
neo4j> create (n:MPasadu {id:true});
0 rows available after 26 ms, consumed after another 0 ms
Added 1 nodes, Set 1 properties, Added 1 labels

and running the following will return the datatypes, but note the id property has multiple datatypes


neo4j> match (n:MPasadu) return n.id,apoc.meta.type(n.id);
+-------------------------------+
| n.id   | apoc.meta.type(n.id) |
+-------------------------------+
| 1      | "INTEGER"            |
| "true" | "STRING"             |
| TRUE   | "BOOLEAN"            |
+-------------------------------

Admittedly I might expect in most cases that a given property on a node is generally all the same datatype, i.e. if you had a property named age, 99% of those properties would be a INTEGER datatype. Is there a benefit to having the datatype? for example without the awareness/detail of the datatype does this cause further downstream effect?

1 Like