Function()
Learn: User-defined functions (UDFs) |
---|
Dynamically get the Function by name.
Examples
Get the function by directly naming the function:
// Call function named `inventory`
inventory('pizza')
{
data: [
{
name: "pizza",
description: "Frozen Cheese",
stock: 92
}
]
}
This equivalent expression gets the function by passing the name of the function as a parameter:
Function('inventory')('pizza')
{
data: [
{
name: "pizza",
description: "Frozen Cheese",
stock: 92
}
]
}
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!