Warning:
Fauna is decommissioning FQL v4 on June 30, 2025.
This driver is not compatible with FQL v10, the latest version. Fauna accounts created after August 21, 2024 must use FQL v10.
Ensure you migrate existing projects to the official v10 driver by the v4 EOL date: https://github.com/fauna/fauna-jvm.
For more information, see the v4 end of life (EOL) announcement and related FAQ.
public final class Language extends Object
import static com.faunadb.client.query.Language.*;
Each of these methods constructs a Expr, which can then be composed with other methods to form complex
expressions.
Examples:
Expr existsValue = Exists(Ref("some/ref"));
Expr createValue = Create(
Ref("classes/some_class"),
Obj("data",
Obj("some", Value("field")))
);
| Modifier and Type | Class and Description |
|---|---|
static class |
Language.Action
Enumeration for event action types.
|
static class |
Language.LetBinding
Builder for let expressions.
|
static class |
Language.Path
Builder for path selectors.
|
static class |
Language.TimeUnit
Enumeration for time units.
|
| Modifier and Type | Method and Description |
|---|---|
static Expr |
Add(Expr... values)
Creates a new Add expression.
|
static Expr |
Add(List<? extends Expr> values)
Creates a new Add expression.
|
static Expr |
And(Expr... values)
Creates a new And expression.
|
static Expr |
And(List<? extends Expr> values)
Creates a new And expression.
|
static Expr |
Append(Expr elements,
Expr collection)
Creates a new Append expression.
|
static Expr |
Arr(Expr... values)
Creates a new Array value containing the provided entries.
|
static Expr |
Arr(List<? extends Expr> values)
Creates a new Array value containing the provided list of values.
|
static Expr |
At(Expr timestamp,
Expr expr)
Creates a new At expression
|
static Expr |
Casefold(Expr str)
Creates a new Casefold expression.
|
static Expr |
Class(Expr name)
Creates a new Class expression.
|
static Expr |
Concat(Expr terms)
Creates a new Concat expression.
|
static Expr |
Concat(Expr terms,
Expr separator)
Creates a new Concat expression.
|
static Expr |
Contains(Expr path,
Expr in)
Creates a new Contains expression.
|
static Expr |
Contains(Language.Path path,
Expr in)
Creates a new Contains expression.
|
static Expr |
Create(Expr ref,
Expr params)
Creates a new Create expression.
|
static Expr |
CreateClass(Expr params)
Creates a new Create Class expression.
|
static Expr |
CreateDatabase(Expr params)
Creates a new Create Database expression.
|
static Expr |
CreateIndex(Expr params)
Creates a new Create Index expression.
|
static Expr |
CreateKey(Expr params)
Creates a new Create Key expression.
|
static Expr |
Database(Expr name)
Creates a new Database expression.
|
static Expr |
Date(Expr str)
Creates a new Date expression.
|
static Expr |
Delete(Expr ref)
Creates a new Delete expression.
|
static Expr |
Difference(Expr... sets)
Creates a new Difference expression.
|
static Expr |
Difference(List<? extends Expr> sets)
Creates a new Difference expression.
|
static Expr |
Distinct(Expr set)
Creates a new Distinct expression.
|
static Expr |
Divide(Expr... values)
Creates a new Divide expression.
|
static Expr |
Divide(List<? extends Expr> values)
Creates a new Divide expression.
|
static Expr |
Do(Expr... exprs)
Creates a new Do expression containing the provided expressions.
|
static Expr |
Do(List<? extends Expr> exprs)
Creates a new Do expression wrapping the provided list of expression.
|
static Expr |
Drop(Expr num,
Expr collection)
Creates a new Drop expression.
|
static Expr |
Epoch(Expr num,
Expr unit)
Creates a new Epoch expression.
|
static Expr |
Epoch(Expr num,
Language.TimeUnit unit)
Creates a new Epoch expression.
|
static Expr |
Equals(Expr... values)
Creates a new Equals expression.
|
static Expr |
Equals(List<? extends Expr> values)
Creates a new Equals expression.
|
static Expr |
Exists(Expr ref)
Creates a new Exists expression.
|
static Expr |
Exists(Expr ref,
Expr timestamp)
Creates a new Exists expression.
|
static Expr |
Filter(Expr collection,
Expr lambda)
Creates a new Filter expression.
|
static Expr |
Foreach(Expr collection,
Expr lambda)
Creates a new Foreach expression.
|
static Expr |
Get(Expr ref)
Creates a new Get expression.
|
static Expr |
Get(Expr ref,
Expr timestamp)
Creates a new Get expression.
|
static Expr |
GT(Expr... values)
Creates a new GT expression.
|
static Expr |
GT(List<? extends Expr> values)
Creates a new GT expression.
|
static Expr |
GTE(Expr... values)
Creates a new GTE expression.
|
static Expr |
GTE(List<? extends Expr> values)
Creates a new GTE expression.
|
static Expr |
Identify(Expr ref,
Expr password)
Creates a new Identify expression.
|
static Expr |
If(Expr condition,
Expr thenExpr,
Expr elseExpr)
Creates a new If expression.
|
static Expr |
Index(Expr name)
Creates a new Index expression.
|
static Expr |
Insert(Expr ref,
Expr timestamp,
Expr action,
Expr params)
Creates a new Insert expression.
|
static Expr |
Insert(Expr ref,
Expr timestamp,
Language.Action action,
Expr params)
Creates a new Insert expression.
|
static Expr |
Intersection(Expr... sets)
Creates a new Intersection expression.
|
static Expr |
Intersection(List<? extends Expr> sets)
Creates a new Intersection expression.
|
static Expr |
Join(Expr source,
Expr target)
Creates a new Join expression.
|
static Expr |
KeyFromSecret(Expr secret)
Creates a new KeyFromSecret expression.
|
static Expr |
Lambda(Expr var,
Expr expr)
Creates a new Lambda expression.
|
static Language.LetBinding |
Let(Map<String,? extends Expr> bindings)
Creates a new Let expression wrapping the provided map of bindings.
|
static Language.LetBinding |
Let(String v1,
Expr d1)
Creates a new Let expression with the provided bindings.
|
static Language.LetBinding |
Let(String v1,
Expr d1,
String v2,
Expr d2)
Creates a new Let expression with the provided bindings.
|
static Language.LetBinding |
Let(String v1,
Expr d1,
String v2,
Expr d2,
String v3,
Expr d3)
Creates a new Let expression with the provided bindings.
|
static Language.LetBinding |
Let(String v1,
Expr d1,
String v2,
Expr d2,
String v3,
Expr d3,
String v4,
Expr d4)
Creates a new Let expression with the provided bindings.
|
static Language.LetBinding |
Let(String v1,
Expr d1,
String v2,
Expr d2,
String v3,
Expr d3,
String v4,
Expr d4,
String v5,
Expr d5)
Creates a new Let expression with the provided bindings.
|
static Expr |
Login(Expr ref,
Expr params)
Creates a new Login expression.
|
static Expr |
Logout(Expr invalidateAll)
Creates a new Logout expression.
|
static Expr |
LT(Expr... values)
Creates a new LT expression.
|
static Expr |
LT(List<? extends Expr> values)
Creates a new LT expression.
|
static Expr |
LTE(Expr... values)
Creates a new LTE expression.
|
static Expr |
LTE(List<? extends Expr> values)
Creates a new LTE expression.
|
static Expr |
Map(Expr collection,
Expr lambda)
Creates a new Map expression.
|
static Expr |
Match(Expr index)
Creates a new Match expression.
|
static Expr |
Match(Expr index,
Expr term)
Creates a new Match expression.
|
static Expr |
Modulo(Expr... values)
Creates a new Modulo expression.
|
static Expr |
Modulo(List<? extends Expr> values)
Creates a new Modulo expression.
|
static Expr |
Multiply(Expr... values)
Creates a new Multiply expression.
|
static Expr |
Multiply(List<? extends Expr> values)
Creates a new Multiply expression.
|
static Expr |
NextId()
Creates a new NextId expression.
|
static Expr |
Not(Expr bool)
Creates a new Not expression.
|
static Expr |
Null()
Creates a null value.
|
static Expr |
Obj()
Creates an empty Object value.
|
static Expr |
Obj(Map<String,? extends Expr> values)
Creates a new Object value wrapping the provided map.
|
static Expr |
Obj(String k1,
Expr v1)
Creates a new Object value with the provided entries.
|
static Expr |
Obj(String k1,
Expr v1,
String k2,
Expr v2)
Creates a new Object value with the provided entries.
|
static Expr |
Obj(String k1,
Expr v1,
String k2,
Expr v2,
String k3,
Expr v3)
Creates a new Object value with the provided entries.
|
static Expr |
Obj(String k1,
Expr v1,
String k2,
Expr v2,
String k3,
Expr v3,
String k4,
Expr v4)
Creates a new Object value with the provided entries.
|
static Expr |
Obj(String k1,
Expr v1,
String k2,
Expr v2,
String k3,
Expr v3,
String k4,
Expr v4,
String k5,
Expr v5)
Creates a new Object value with the provided entries.
|
static Expr |
Or(Expr... values)
Creates a new Or expression.
|
static Expr |
Or(List<? extends Expr> values)
Creates a new Or expression.
|
static Pagination |
Paginate(Expr resource)
Creates a new Paginate expression.
|
static Language.Path |
Path(int... segments)
Helper for constructing a Path with the given elements indexes.
|
static Language.Path |
Path(String... segments)
Helper for constructing a Path with the given path terms.
|
static Expr |
Prepend(Expr elements,
Expr collection)
Creates a new Prepend expression.
|
static Expr |
Ref(Expr classRef,
Expr id)
Calls ref function to create a ref value.
|
static Expr |
Ref(Expr classRef,
String id)
Calls ref function to create a ref value.
|
static Expr |
Ref(String ref)
Creates a new RefV literal value.
|
static Expr |
Remove(Expr ref,
Expr timestamp,
Expr action)
Creates a new Remove expression.
|
static Expr |
Remove(Expr ref,
Expr timestamp,
Language.Action action)
Creates a new Remove expression.
|
static Expr |
Replace(Expr ref,
Expr params)
Creates a new Replace expression.
|
static Expr |
Select(Expr path,
Expr from)
Creates a new Select expression.
|
static Expr |
Select(Expr path,
Expr from,
Expr defaultValue)
Creates a new Select expression.
|
static Expr |
Select(Language.Path path,
Expr from)
Creates a new Select expression.
|
static Expr |
Select(Language.Path path,
Expr from,
Expr defaultValue)
Creates a new Select expression.
|
static Expr |
Subtract(Expr... values)
Creates a new Subtract expression.
|
static Expr |
Subtract(List<? extends Expr> values)
Creates a new Subtract expression.
|
static Expr |
Take(Expr num,
Expr collection)
Creates a new Take expression.
|
static Expr |
Time(Expr str)
Creates a new Time expression.
|
static Expr |
Union(Expr... sets)
Creates a new Union expression operating on the given sets.
|
static Expr |
Union(List<? extends Expr> sets)
Creates a new Union expression.
|
static Expr |
Update(Expr ref,
Expr params)
Creates a new Update expression.
|
static Expr |
Value(boolean value)
Creates a new Boolean value.
|
static Expr |
Value(byte[] bytes)
Creates a new Bytes value.
|
static Expr |
Value(double value)
Creates a new Double value.
|
static Expr |
Value(HighPrecisionTime value)
Creates a new Timestamp value from a high precision time.
|
static Expr |
Value(Instant value)
Creates a new Timestamp value.
|
static Expr |
Value(LocalDate value)
Creates a new Date value.
|
static Expr |
Value(long value)
Creates a new Long value.
|
static Expr |
Value(String value)
Creates a new String value.
|
static Expr |
Var(String name)
Creates a new Var expression.
|
public static Expr Ref(String ref)
public static Expr Ref(Expr classRef, Expr id)
public static Expr Ref(Expr classRef, String id)
public static Expr Value(String value)
public static Expr Value(long value)
public static Expr Value(double value)
public static Expr Value(boolean value)
public static Expr Value(Instant value)
public static Expr Value(HighPrecisionTime value)
HighPrecisionTimepublic static Expr Value(LocalDate value)
public static Expr Value(byte[] bytes)
public static Expr Null()
public static Expr Obj(Map<String,? extends Expr> values)
public static Expr Obj()
public static Expr Obj(String k1, Expr v1)
public static Expr Obj(String k1, Expr v1, String k2, Expr v2)
public static Expr Obj(String k1, Expr v1, String k2, Expr v2, String k3, Expr v3)
public static Expr Obj(String k1, Expr v1, String k2, Expr v2, String k3, Expr v3, String k4, Expr v4)
public static Expr Obj(String k1, Expr v1, String k2, Expr v2, String k3, Expr v3, String k4, Expr v4, String k5, Expr v5)
public static Expr Arr(List<? extends Expr> values)
public static Expr Arr(Expr... values)
public static Expr At(Expr timestamp, Expr expr)
public static Language.LetBinding Let(Map<String,? extends Expr> bindings)
public static Language.LetBinding Let(String v1, Expr d1)
public static Language.LetBinding Let(String v1, Expr d1, String v2, Expr d2)
public static Language.LetBinding Let(String v1, Expr d1, String v2, Expr d2, String v3, Expr d3)
public static Language.LetBinding Let(String v1, Expr d1, String v2, Expr d2, String v3, Expr d3, String v4, Expr d4)
public static Language.LetBinding Let(String v1, Expr d1, String v2, Expr d2, String v3, Expr d3, String v4, Expr d4, String v5, Expr d5)
public static Expr Var(String name)
public static Expr If(Expr condition, Expr thenExpr, Expr elseExpr)
public static Expr Do(List<? extends Expr> exprs)
public static Expr Do(Expr... exprs)
public static Expr Lambda(Expr var, Expr expr)
public static Expr Map(Expr collection, Expr lambda)
public static Expr Foreach(Expr collection, Expr lambda)
public static Expr Filter(Expr collection, Expr lambda)
public static Expr Take(Expr num, Expr collection)
public static Expr Drop(Expr num, Expr collection)
public static Expr Prepend(Expr elements, Expr collection)
public static Expr Append(Expr elements, Expr collection)
public static Expr Get(Expr ref)
public static Expr Get(Expr ref, Expr timestamp)
public static Expr KeyFromSecret(Expr secret)
public static Pagination Paginate(Expr resource)
Pagination,
FaunaDB Read Functionspublic static Expr Exists(Expr ref)
public static Expr Exists(Expr ref, Expr timestamp)
public static Expr Create(Expr ref, Expr params)
public static Expr Update(Expr ref, Expr params)
public static Expr Replace(Expr ref, Expr params)
public static Expr Delete(Expr ref)
public static Expr Insert(Expr ref, Expr timestamp, Expr action, Expr params)
public static Expr Insert(Expr ref, Expr timestamp, Language.Action action, Expr params)
public static Expr Remove(Expr ref, Expr timestamp, Expr action)
public static Expr Remove(Expr ref, Expr timestamp, Language.Action action)
public static Expr CreateClass(Expr params)
public static Expr CreateDatabase(Expr params)
public static Expr CreateKey(Expr params)
public static Expr CreateIndex(Expr params)
public static Expr Match(Expr index)
public static Expr Match(Expr index, Expr term)
public static Expr Union(List<? extends Expr> sets)
public static Expr Union(Expr... sets)
public static Expr Intersection(List<? extends Expr> sets)
public static Expr Intersection(Expr... sets)
public static Expr Difference(List<? extends Expr> sets)
public static Expr Difference(Expr... sets)
public static Expr Distinct(Expr set)
public static Expr Join(Expr source, Expr target)
public static Expr Login(Expr ref, Expr params)
public static Expr Logout(Expr invalidateAll)
public static Expr Identify(Expr ref, Expr password)
public static Expr Concat(Expr terms)
public static Expr Concat(Expr terms, Expr separator)
public static Expr Casefold(Expr str)
public static Expr Time(Expr str)
public static Expr Epoch(Expr num, Language.TimeUnit unit)
public static Expr Epoch(Expr num, Expr unit)
public static Expr Date(Expr str)
public static Expr NextId()
public static Expr Class(Expr name)
public static Expr Database(Expr name)
public static Expr Index(Expr name)
public static Expr Equals(List<? extends Expr> values)
public static Expr Equals(Expr... values)
public static Expr Contains(Expr path, Expr in)
public static Expr Contains(Language.Path path, Expr in)
public static Language.Path Path(String... segments)
Language.Pathpublic static Language.Path Path(int... segments)
Language.Pathpublic static Expr Select(Expr path, Expr from)
public static Expr Select(Expr path, Expr from, Expr defaultValue)
public static Expr Select(Language.Path path, Expr from)
public static Expr Select(Language.Path path, Expr from, Expr defaultValue)
public static Expr Add(List<? extends Expr> values)
public static Expr Add(Expr... values)
public static Expr Multiply(List<? extends Expr> values)
public static Expr Multiply(Expr... values)
public static Expr Subtract(List<? extends Expr> values)
public static Expr Subtract(Expr... values)
public static Expr Divide(List<? extends Expr> values)
public static Expr Divide(Expr... values)
public static Expr Modulo(List<? extends Expr> values)
public static Expr Modulo(Expr... values)
public static Expr LT(List<? extends Expr> values)
public static Expr LT(Expr... values)
public static Expr LTE(List<? extends Expr> values)
public static Expr LTE(Expr... values)
public static Expr GT(List<? extends Expr> values)
public static Expr GT(Expr... values)
public static Expr GTE(List<? extends Expr> values)
public static Expr GTE(Expr... values)
public static Expr And(List<? extends Expr> values)
public static Expr And(Expr... values)
public static Expr Or(List<? extends Expr> values)
public static Expr Or(Expr... values)
public static Expr Not(Expr bool)