My APOC Function
CALL apoc.trigger.add('updateTrigger',
'UNWIND keys($assignedNodeProperties) as k
UNWIND $assignedNodeProperties[k] AS prop
with prop.node AS node, prop.key AS key, prop.old AS oldValue, prop.new AS newValue
with {
key:key,
oldValue:oldValue,
newValue:newValue,
elementId:elementId(node),
createdDateTime:timestamp()} as requestBody
CALL apoc.load.jsonParams("https://us-central1-kampl-fcid.cloudfunctions.net/SLI/api/slidt-apoc",
{method: "POST"},
apoc.convert.toJson(requestBody)
) yield value return value
', {phase:'before'});`
whenever i will update my property it should call POST API request
In this requestBody i want to pass all values.
My APOC Trigger Works but when i pass my requestBody to the apoc.convert.toJson(body) method
i got my requestBody map like
{"{key:"surname",oldValue:"Smith",newValue:"Burgman"}":""}}
I don't know why my requestBody became key in this scenario
is there any syntax error
please let me know.
I want to achieve this on my cloud function
{key:"surname",oldValue:"Smith",newValue:"Burgman"}
I print this bodyRequest on my firebase cloud function console using below method
app.post("/api/slidt-apoc", (req, res) => {
let body = req.body;
let data=JSON.stringify(body)
console.log("Request Data "+data);
}
I got above result
Please help