Search code examples
neo4jcypherneo4j-apoc

Can't query created nodes from apoc.load.xml


I successfully loaded a XML file with apoc.load.xml and created nodes & relationships with Neo4j 4.0.3, below some parts of the load XML:

call apoc.load.xml("file:/import.xml",'/doc/obj',{}, false) yield value as II
unwind II._children as RA
unwind RA._children as RA2
unwind RA2._children as RA3
with II.type as Type,
…
merge(e:Element{name:NAME, guid:GUID})
merge(t:Type{name:Type})
merge(e)-[:of]->(t)
return e,t

The nodes, relations and properties are visible, but I can't query the nodes based on any property value.

match(n:Element) where n.name = "element1" return n

(no changes, no records)

whereas searching for id(n) is working fine //match(n:Element) where id(n) > 10 return n

Any ideas why I can't query for property values for the newly created elements?


Solution

  • apparently the name property contains an array after import, in which case this should work

    match(n:Element) 
    where n.name[0] = "element1" 
    return n
    

    OR

    match(n:Element) 
    where "element1" IN n.name 
    return n