Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
06-08-2021 09:36 AM
Hello all,
I am new to Cypher and Neo4j and I would like some help in my first steps.
I have imported a Json file (with apoc plugin) with the upper level to be the field "executions" and in the nested part with some subfields with which I have created relationships and nodes.
I run the following query and it returns nothing. (As syntax is correct).
<WITH "file:///myfilejson"
AS myjson
CALL apoc.load.json(myjson)
YIELD value
UNWIND value.executions as e
MATCH (execution: Execution {id:e.id})
WHERE e.id = '15203'
RETURN e.status />
Where I have done a mistake? In general i am confused how to use the "WHERE" clause in the data I have imported.
However, I have already succesfully created nodes and relationships with the following:
WITH "file:///myfile.json"
AS myjson
CALL apoc.load.json(myjson)
YIELD value
UNWIND value.executions as e
FOREACH (exec IN e | MERGE (execution: Execution {id:e.id} ) MERGE(status:Exec_Status {sts:e.status}) MERGE (execution)-[:MARKED_AS]->(status)
<MERGE (t:Tester {name:e.testerName}) MERGE((t)-[:PERFORMED]->(execution)) MERGE (p:Project {name: e.project.name})
MERGE((p)-[:BELONGS_TO]->(execution)) MERGE((t)-[:PERFORMED]->(execution)) MERGE (type:Execution_Type {name: e.executionType})
MERGE((execution)-[:EXEC_TYPE]->(type)) MERGE (tcid:TestCaseId {name: e.testCase.id}) MERGE((execution)-[:HAS_TC_ID]->(tcid))) />
06-18-2021 10:30 AM
what is the type of the .id property on that node? Could you check?
If it is an integer that would explain the query results. (it looks like it is an integer value, in the json example)
06-18-2021 04:16 PM
Used your sample file and imported the data.
Result:
Ran this query:
match (e:Execution)-[]-(a:Exec_Status)
where e.id = 15144
return e.id as ID, a.sts as status
Result:
All the sessions of the conference are now available online