Function
Function( name, [database] )
Description
The Function
function returns a Reference for the specified
function name
in the specified child database
. If a child database
is not specified, the returned function reference belongs to the current
database.
Returns
A reference to a function with the specified name
, in the specified
child database
(or the current database if database
is not
specified).
Examples
-
The following query gets a reference to the function named
increment
in the current database:Function("increment")
-
The following query gets a Reference to the function named
increment
in a child database named "child_db":Function("increment", Database("child_db"))
-
The following query demonstrates how to retrieve the function document by its reference:
{ ref: Function("increment"), ts: 1624310406060000, name: 'increment', body: Query(Lambda("X", Add(Var("X"), 1))) }
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!