Skip to content

Apoc.trigger.propertiesByKey adding a dynamic label based on newValue vs oldValue does not work #395

@tomasonjo

Description

@tomasonjo

I have been playing around with apoc.trigger. I created a (a:Test{number:5}) and below query for apoc.trigger, then tried to set the number different, and it does not update labels as it should. Tried out only inner statement with hardcoded values and it works. Using Neo4j 3.1.3 and APOC 3.1.3.6. Nothing in debug.log

CALL apoc.trigger.add('test','UNWIND apoc.trigger.propertiesByKey({assignedNodeProperties},"number") AS prop 
WITH prop.node as n,CASE WHEN toFLOAT(prop.oldValue) < toFLOAT(prop.newValue) THEN "increasing" ELSE "decreasing" END AS label 
CALL apoc.create.addLabels( [n], [label]) YIELD node RETURN "none"', {phase:'after'})

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions