Rank 2: Process
When I setup a function that gets called by a document.create does this function intercept the creation of the document and I have to create it myself with the given payload or how does that work?
Votes
0
Replies
23
Participants
Unknown
Messages
24
Rank 2: Process
When I setup a function that gets called by a document.create does this function intercept the creation of the document and I have to create it myself with the given payload or how does that work?
Rank 5: Hypervisor
nope, function doesn't intercept, function get trigger once doc successfully get created...
Rank 5: Hypervisor
yap, if you want to prevent user from creating Doc directly, you can use the function where user pass the Data
Rank 2: Process
That’s bad 😅
It would be soooo easy
Rank 2: Process
Yeah that’s exactly what I don’t want to do haha
Rank 5: Hypervisor
I mean, yaa but as Function act as Serverless so in that sense it's not possible...
Rank 2: Process
Yeah makes sense 🫠
Rank 5: Hypervisor
can understand but, for security is concern so that's ideal approach
Rank 2: Process
Oke thx 🙏🏻
Have a nice day!
Rank 5: Hypervisor
no prob you too 🙂
Rank 2: Process
Oh another quick question 😅
Do you think it’s faster to make standalone functions for stuff I need to check on every execution or should I just paste this code in every function?
Rank 2: Process
Hope you understand what I mean
Rank 5: Hypervisor
it's generally idea to have seperate function, not just that it will faster ( I mean relative faster not compareabily) , but also another reason to have smaller function is to seperate area of concern
Rank 5: Hypervisor
so, if one function have bug another function still will work and user don't have to wait for issue for that function to be fixed
Rank 2: Process
True
Rank 2: Process
Will the functions automatically get called locally? Or can I force this somehow?
Rank 5: Hypervisor
it have both behaviour, it can be called manually via SDK or automatically trigger whenever new action happen such as document creation, new user regsitation etc...
Rank 5: Hypervisor
it's upto you how you would like func to work
Rank 2: Process
I mean if I trigger func 1 from my client and then func 2 gets triggered from inside func 1.
Does func 2 gets automatically called locally?
Rank 5: Hypervisor
oh yaap
Rank 5: Hypervisor
one function can call another function internally*
Rank 2: Process
Okay and this happens automatically?
So it does not do the round trip over the external api endpoint?
Rank 5: Hypervisor
yap it happen internally, round trip nope it doesn't
Rank 2: Process
👍🏻