FQL v4 will be decommissioned on June 30, 2025. Ensure that you complete your migration from FQL v4 to FQL v10 by that date.

Fauna accounts created after August 21, 2024 must use FQL v10. These accounts will not be able to run FQL v4 queries or access the v4 Dashboard.

For more details, see the v4 EOL announcement and migration guide. Contact support@fauna.com with any questions.

Concat

This reference topic applies to FQL v4. Go to this page for the latest FQL v10 reference topics.

Concat( value, [ separator ] )
concat( value, [ separator ] )
Concat( value, [ separator ] )
Concat( value, [ separator ] )
Concat( value, [ separator ] )
Concat( value, [ separator ] )

Description

The Concat function returns a string which has joined a list of strings into a single string.

Parameters

Parameter Type Definition and Requirements

value

Array of Strings

An array of strings to join.

separator

String

Optional - This value is placed between each joined string. Default is an empty string ("").

Returns

A string value.

Examples

The following query takes an array of Strings containing "Hen" and "Wen" as its first argument and a separator of a space (" ") as its second argument. The result of the Concat operation is "Hen Wen".

client.query(
  q.Concat(['Hen', 'Wen'], ' ')
)
.then((ret) => console.log(ret))
.catch((err) => console.error(
  'Error: [%s] %s: %s',
  err.name,
  err.message,
  err.errors()[0].description,
))
Hen Wen
result = client.query(
    q.concat(["Hen", "Wen"], " ")
)
print(result)
Hen Wen
result, err := client.Query(
	f.Concat(f.Arr{"Hen", "Wen"}, f.Separator(" ")))

if err != nil {
	fmt.Fprintln(os.Stderr, err)
} else {
	fmt.Println(result)
}
Hen Wen
try
{
    Value result = await client.Query(
        Concat(Arr("Hen", "Wen"), " ")
    );
    Console.WriteLine(result);
}
catch (Exception e)
{
    Console.WriteLine($"ERROR: {e.Message}");
}
StringV(Hen Wen)
System.out.println(
    client.query(
        Concat(Arr(Value("Hen"), Value("Wen")), Value(" "))
    ).get());
"Hen Wen"
Concat(['Hen', 'Wen'], ' ')
'Hen Wen'
Query metrics:
  •    bytesIn:  40

  •   bytesOut:  22

  • computeOps:   1

  •    readOps:   0

  •   writeOps:   0

  •  readBytes:   0

  • writeBytes:   0

  •  queryTime: 5ms

  •    retries:   0

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!