I have a query regarding UDFs and API pricing. I’m just learning FQL so sorry if this question isn’t explained well.
There is this example in the documentation
Map(
[ 1, 2, 3, 4, 5 ],
Lambda(
"number",
Add(1, Var(“number”))
)
)
From what I gather this means the Lambda part will call the Add function 5 times, once for each of the items in the array. So in terms of UDF and API pricing how is this charged. How many TROs and TCOs is this priced at. I guess I’m wondering is if an FQL hit a collection that had 1 million documents and performed a lambda on each document is that 1 million TROs and 1 million TCOs.
Trying to get my head around what costs are involved in our planned system.
As stated in the pricing tab on Fauna: ‘an API call that contains up to 50 function calls requires one TCO’. I’m not sure if Lambda and Add functions here are counted separately or together, but I am sure that the example you have given would take up just one TCO and TRO.
I’m not convinced. I did practically nothing in my test database yesterday yet there is quite a few TCOs and TROs reported for yesterday. I’d just like to know what we are paying for before we develop and get slugged with charges.
Is there a way to run an FQL statement and see the TCOs and TROs used for that FQL?
@MMJM You could run a query in WebShell and check the usage. Below is an example. Look for (byteReadOps, byteWriteOps, computeOps). You can find more info here too.