Function()
Learn: User-defined functions |
---|
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",
quantity: 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",
quantity: 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!