Add

Add( value_1, value_2, ... )
Add( value_1, value_2, ... )
Add( value_1, value_2, ... )
Add( value_1, value_2, ... )
add( value_1, value_2, ... )
add  value_1, value_2, ...
Add( value_1, value_2, ... )
Add( value_1, value_2, ... )

Description

The Add function returns the sum of its numeric arguments. It can take a single value or a list of values. Providing a single number returns the number.

Parameters

Argument Type Definition and Requirements

value

Number

One or more numbers to sum.

Returns

A number which is the sum of all values.

Examples

The query below returns the sum of 100 and 10.

curl https://db.fauna.com/ \
    -u fnAChGwBcAACAO70ziE0cfROosNJHdgBmJU1PgpL: \
    -d '{ "add": [ 100, 10 ] }'
client.Query(Add(100, 10));
System.out.println(
    client.query(Add(Value(100), Value(10)))
    .get());
result, _ := client.Query(f.Add(100, 10))

fmt.Println(result)
client.query(Add(100, 10))
client.query(q.add(100, 10))
$client.query do
  add 100, 10
end
client.query(Add(100, 10))
client.query(q.Add(100, 10))
  .then((ret) => console.log(ret))
HTTP/1.1 200 OK
{ "resource": 110 }
110
110
110
110
110
110
110
110

Was this article helpful?

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

Thank you for your feedback!