I have a delete authentication trigger with the following linked function:
exports = function(authEvent) {
const mongodb = context.services.get("mongodb-atlas");
const items = mongodb.db("realm-swift-template").collection("Item");
const userId = authEvent.userId
items.deleteMany({ userId })
};
I think that deleteMany
can throw an exception. Should I be using a try catch block and schedule the function to run again later?