You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please note that GitHub issues are only meant for bug reports/feature requests. If you have questions on how to use APOC, please ask on the Neo4j Discussion Forum instead of creating an issue here.
Expected Behavior (Mandatory)
deletedNodes should return all properties for the node
Actual Behavior (Mandatory)
deletedNodes return empty properties map, with negative element id
How to Reproduce the Problem
Simple Dataset (where it's possibile)
//Insert here a set of Cypher statements that helps us to reproduce the problem
CREATE(n:SomeNew {uuid:"2d3d53e5-352f-4d2b-bbbe-656b4bcc2b34"})
Steps (Mandatory)
add trigger
:use system;
CALL apoc.trigger.install(
'neo4j',
'add delete node log',
'
UNWIND $deletedNodes as n
WITH n
WHERE NOT "Log" in labels(n)
CREATE (log:Log)
SET
log.data=apoc.convert.toJson(properties(n)),
log.nodeId = elementId(n)
',
{phase:'afterAsync'}
);
delete the node
MATCH(n:SomeNew {uuid:"2d3d53e5-352f-4d2b-bbbe-656b4bcc2b34"})
DELETE n
query the log node
MATCH(n:Log)
RETURN n
Screenshots (where it's possibile)
The result
data | {} |
nodeId | -2
Specifications (Mandatory)
Currently used versions
Versions
OS: Window
Neo4j: 5.26.1
Neo4j-Apoc: 5.26.1
The text was updated successfully, but these errors were encountered:
Thanks for writing in :) The triggers reference Virtual Nodes and Relationships which means the properties function doesn't work on it, try updating you query to use apoc.any.properties(n) instead:
:use system;
CALL apoc.trigger.install(
'neo4j',
'add delete node log',
'
UNWIND $deletedNodes as n
WITH n
WHERE NOT "Log" in labels(n)
CREATE (log:Log)
SET
log.data=apoc.convert.toJson(apoc.any.properties(n)),
log.nodeId = elementId(n)
',
{phase:'afterAsync'}
);
The element id is not supported yet for the way these virtual nodes are created, so that is a bug, I will create a ticket for this part.
I see the documentation is lacking any information about this limitation so will make a ticket for my team to fix up. Let me know if this solves your issue! Thanks :D
Yep, unfortunately the error part would actually need to be implemented on the Neo4j side. There is a card someone else made who had encountered a similar issue so that may one day be fixed.
We have updated the docs now too, so I will close this :) Thanks for writing in!
Guidelines
Please note that GitHub issues are only meant for bug reports/feature requests. If you have questions on how to use APOC, please ask on the Neo4j Discussion Forum instead of creating an issue here.
Expected Behavior (Mandatory)
deletedNodes should return all properties for the node
Actual Behavior (Mandatory)
deletedNodes return empty properties map, with negative element id
How to Reproduce the Problem
Simple Dataset (where it's possibile)
Steps (Mandatory)
Screenshots (where it's possibile)
The result
Specifications (Mandatory)
Currently used versions
Versions
The text was updated successfully, but these errors were encountered: