I am trying to limit document creation of my each subscriber for a certain number of documents.
In my cloud function, I create an onCreate trigger and even I return "null" if document count doesn't match with my limits, firestore still creates this document.
I digged into firestore and cloud functions documentations but could not find any example how to cancel/abort a cloud function trigger.
Bonus question; Do I have any way to alert customer wheter he/she exceeded the limit of this document creation? I thought I can update a seperate alert document in my trigger function and read and display this to customer. Do you know any way to listen onCreate trigger's result and display the error real time?
Any help please? Many Thanks.