Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-07-2019 11:58 PM
Hello,
I would like to know if there is a difference between int property or a string property in the following scenario:
I have multiple relations and every one of them have an "index" property.
Until now i have had strings of int in the property - "1", "12", "63".
Here is my question - Is there a difference between my current scenario to a scenario that the property is of type int?
If there is a difference, what is it?
thank you very much
04-08-2019 12:30 AM
Hi @o9384496,
You will have data type mismatch when querying an int when it's actually a string.
When you are searching for the string as an "int" you should use Scalar functions like toInteger() for queries. -->
https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-tointeger
to check the datatype of the property use type(property). -->
https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-type
04-11-2019 03:41 AM
Yes I know.
My question was what is the best way, to use an int or a string.
Of course my queries will use the data type that is in the db
06-04-2019 03:50 AM
Hi @o9384496,
I don't know how extra process Neo4j is doing on ints and strings but
I think int is better because it uses just 8 bytes, also usually most of its bits are 0, so needs lesser processes.
All the sessions of the conference are now available online