I am trying to put a trigger on a Collection, and it appears to not be tripping. The Trigger is prepared with the Azure Portal. I was trying specific logic - but in the end just placed an example on the Azure Site. The Trigger logic is the following:
var context = getContext();
var request = context.getRequest();
// document to be created in the current operation
var documentToCreate = request.getBody();
// validate properties
if (!("timestamp" in documentToCreate))
{
var ts = new Date();
documentToCreate["my timestamp"] = ts.getTime();
}
// update the document that will be created
request.setBody(documentToCreate);
The trigger is not working. No errors appear to be generated and I am unsure what is going on.
Note: the trigger is a pre crate trigger. And for the trigger logic I listed I am not creating a document with a "my timestamp" property. I have also tested other scenarios along the same concept where I want to add an attribute to the document being created.