Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-29-2020 04:12 AM
I am trying to add multiple values to a property, like a list kind of solution. The eventual aim of this endeavour is to be able to search the values for the property 'Synoniem' separately, so that if a search query finds one word in the list (and not all per se) returns the node that is attached to the property.
I have tried this:
//Import data directly into Neo4j 1.01
MERGE (:Onderneming {Naam:"De Haspel", Contactpersoon:"Kees van Dis"})
MERGE (:Onderneming {Naam:"ProPlant", Contactpersoon:"Annechien de Rooij"})
MERGE (:Onderneming {Naam:"Heerlijk Land", Contactpersoon:"Maarten Bril"})
MERGE (:Onderneming {Naam:"Bloemenboter", Contactpersoon:"Patty Broek"})
MERGE (:Kernactiviteit {Kernactiviteit:"Agro-ecologie", Synoniem:"Agro-forestry", Synoniem:"Agroecologie"})
And also this doesn't work:
//Import data directly into Neo4j 1.01
MERGE (:Onderneming {Naam:"De Haspel", Contactpersoon:"Kees van Dis"})
MERGE (:Onderneming {Naam:"ProPlant", Contactpersoon:"Annechien de Rooij"})
MERGE (:Onderneming {Naam:"Heerlijk Land", Contactpersoon:"Maarten Bril"})
MERGE (:Onderneming {Naam:"Bloemenboter", Contactpersoon:"Patty Broek"})
MERGE (:Kernactiviteit {Kernactiviteit:"Agro-ecologie", Synoniem:"Agro-forestry", "Agroecologie"})
Any smart words of advice?
Solved! Go to Solution.
11-03-2020 09:26 AM
Try this:
MATCH (n:Onderneming) WHERE "Agroecologie" IN n.Synoniem
RETURN n;
10-29-2020 01:02 PM
Try this:
Add multiple values as a list:
MERGE (a:Kernactiviteit {Kernactiviteit:"Agro-ecologie", Synoniem:["Agro-forestry", "Agroecologie"]})
MATCH (c) where exists (c.Synoniem)
RETURN c
11-03-2020 06:07 AM
@ameyasoft, you are right about the first part of the query, that is adding all Synoniems as properties to nodes with a .
But then for the second part, its is not my purpose to return all nodes that have a Synoniem property. It is my purpose to return all nodes with a specific Synoniem property. So, I want Neo4j to treat the values of Synoniem as separately searchable variables.
In addition to you coding, I have tried these, without luck:
MATCH (n:Onderneming) WHERE n.Synoniem="Agroecologie" RETURN n;
MATCH (n:Onderneming) WHERE n.Synoniem CONTAINS "Agroecologie" RETURN n;
Any suggestions?
11-03-2020 09:26 AM
Try this:
MATCH (n:Onderneming) WHERE "Agroecologie" IN n.Synoniem
RETURN n;
11-06-2020 01:18 AM
Thank you, that was it 🙂
All the sessions of the conference are now available online