Function

Function( name )
Function( name )
Function( name )
Function( name )
function( name )
function name
Function( name )
Function( name )

Description

The Function function returns a Ref for the given function name.

Parameters

Argument Type Definition and Requirements

name

String

The name of a function.

Returns

A reference to a function with the provided name.

Examples

The query below gets a reference to the function named increment.

curl https://db.fauna.com/ \
    -u fnAChGwBcAACAO70ziE0cfROosNJHdgBmJU1PgpL: \
    -d '{ "function": "increment" }'
client.Query(Function("increment"));
System.out.println(client.query(Function(Value("increment"))).get());
result, _ := client.Query(f.Function("increment"))

fmt.Println(result)
client.query(Function("increment"))
client.query(q.function("increment"))
$client.query do
  function 'increment'
end
client.query(Function("increment"))
client.query(q.Function("increment"))
  .then((ret) => console.log(ret))
HTTP/1.1 200 OK
{ "resource": { "@ref": "functions/increment" } }
{ "@ref": "functions/increment" }
ref(id = "increment", class = ref(id = "functions"))
{increment 0xc4202dd9a0 <nil>}
{ "@ref": "functions/increment" }
{ "@ref": "functions/increment" }
{ "@ref": "functions/increment" }
{ "@ref": "functions/increment" }
Ref(id=increment, class=Ref(id=functions))

Was this article helpful?

We're sorry to hear that.
Tell us how we can improve! documentation@fauna.com

Thank you for your feedback!