How to set options {memory: "1GiB"}
on firestore triggered cloud function.
I can’t find it in the documentation: https://firebase.google.com/docs/functions/2nd-gen-upgrade
There is an exemple for https functions but it seem to have a different syntaxe for onDocumentCreated(), etc..
export const statisticsDataCreated = onDocumentCreated("statistics/data", async (event) => {
/** Do things **/
});
Did you find the way to achieve it ?
2
Answers
As far I can see in docs here (https://firebase.google.com/docs/functions/manage-functions?gen=2nd&hl=it#set_timeout_and_memory_allocation)
the options can be passed as the first argument before the callback function itself:
While there is not a specific example on the onDocumentCreated trigger, I would suggest you to use it like this:
you can use runWith to set runtime options