I have written a buggy cypher script, but I cannot find the actual problem.
Here is the crucial part of the script:
:begin
:param measured => 'heat';
:param vals => [
{d: datetime({year: 2022, month: 1, day: 1, hour: 4}), v: 47980},
{d: datetime({year: 2022, month: 2, day: 1, hour: 4}), v: 50840},
{d: datetime({year: 2022, month: 3, day: 1, hour: 4}), v: 53190}];
MATCH (i:Installation:HeatPump {name: "Demoanlage"})--(m:MeasurementSite {measuredObj: $measured})--(me:Meter)
WHERE ID(i) = $hpId WITH me UNWIND $vals as val
MERGE (me)-[:MEASURED_MANUALLY {createdAt: datetime.transaction()}]->
(v:Val {d: val.d, v: val.v}) RETURN v;
:commit
There is one more :begin :commit
block, this might also be a problem.
When I run this script I am getting the following output:
// using a cypher shell
sdptest@neo4j> :source /home/myname/path/to/cypher-scripts/data_imports/add_demo_hp_vals.cypher;
org/neo4j/internal/helpers/collection/Pair // this is in red, kind of error message
sdptest@neo4j# // note the hash instead of the 'greater than' sign
For making the question clearer: I don't get the org/neo4j/internal/helpers/collection/Pair
'error' and I don't get why the hash suddenly shows up (which looks like a root user in a usual linux shell)?
Googling did not help.
(Version: Neo4j 4.4.9, cypher-shell the same).
Edit
May it is not allowed to add parameter in scripted transaction (:begin :commit
)? Because the query seems to be OK to me.