Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
06-22-2020 01:10 AM
I am working together with a colleague, on a remote Graph DB. When I create nodes and relationships in my Neo4j browser, everything works and looks normal. But when he creates new relationships either with his Neo4j browser or via PHP Neo4j driver, using either CREATE or MERGE, instead of the new relationship - two duplicated (gray colored) nodes are introduced and relationship between them, and no relationship between the original nodes.
Is there any explanation for this problem, and how to resolve it?
Solved! Go to Solution.
06-22-2020 03:18 AM
Hi,
that sounds like he is not using a MATCH statement before he is creating or merging. So, I guess the command your colleague is using kind of looks like this:
MERGE (a:Node {id:5})-[:IS_CONNECTED_TO]->(b:Node {id:6})
Now, even if there are nodes a and b with the desired ids, this will create two new nodes which are connected and not connect the existing ones.
Instead of that your colleague should use
MATCH (a:Node {id:5}), (b:Node {id:6})
MERGE (a)-[:IS_CONNECTED_TO]->(b)
That also explains the "grayness" of the nodes. If there are certain labels missing, then they are not coloured in the colouring scheme that applies to all other nodes.
I hope this helps.
Regards,
Elena
06-22-2020 03:18 AM
Hi,
that sounds like he is not using a MATCH statement before he is creating or merging. So, I guess the command your colleague is using kind of looks like this:
MERGE (a:Node {id:5})-[:IS_CONNECTED_TO]->(b:Node {id:6})
Now, even if there are nodes a and b with the desired ids, this will create two new nodes which are connected and not connect the existing ones.
Instead of that your colleague should use
MATCH (a:Node {id:5}), (b:Node {id:6})
MERGE (a)-[:IS_CONNECTED_TO]->(b)
That also explains the "grayness" of the nodes. If there are certain labels missing, then they are not coloured in the colouring scheme that applies to all other nodes.
I hope this helps.
Regards,
Elena
06-22-2020 07:01 AM
Hi,
it seems this solves our problem - thank you!
Regards,
Matjaz
All the sessions of the conference are now available online