Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-07-2021 09:37 AM
Hello, I have a question about ids to create relationship between two nodes.I have this request:
"MATCH (a:ARTICLE),(w:SOURCE) WHERE a.id=$artid AND w.id=$author_id MERGE (a)-[:HAS_SOURCE]->(w)"
Is it possible to give something else than integers as ids ? For example url ? Strings ?
Or are integers mandatory for ids ?
01-07-2021 10:45 AM
Yes you can use either strings or numbers for id's. Obviously, numbers have the advantage of being more compact and faster to compare than strings.
I will note URL's have a canonicalization problem....
HTTP://NEO4.J.COM
won't exactly match https://neo4j.com
but maybe they should (case and http vs https.)
BUT sometimes case does matter (I really ran into this example in my career).
https://en.wikipedia.org/wiki/Acid
(about chemistry) is DIFFERENT from
https://en.wikipedia.org/wiki/ACID
(about Computer science)
So, I would try to avoid using URLs as keys. It would be a headache.
01-07-2021 02:41 PM
Hi @LJRB , the type of id created are also directly related to performance. In my blog -> Neo4j – Relationship Modelling- Performance – Dominic KUMAR's blog I have a demo on the performance.
All the sessions of the conference are now available online