Check out v4 of the Fauna CLI

v4 of the Fauna CLI is now GA.

The new version introduces enhancements to the developer experience, including an improved authentication workflow. To get started, check out the CLI v4 quick start.

Migrating from v3 of the CLI? See the CLI migration guide.

Bytes()

Convert a Base64-encoded string to an FQL Bytes value.

Signature

Bytes(encoded: String) => Bytes

Description

Converts a Base64-encoded string to an FQL Bytes value. A Bytes value stores a byte array, represented as a Base64-encoded string. You can use Bytes to store binary data in a Fauna database.

This method is equivalent to Bytes.fromBase64().

Parameters

Parameter Type Required Description

encoded

String

true

Base64-encoded string representing a byte array.

Return value

Type Description

Bytes

FQL Bytes value.

Examples

Bytes("SGVsbG8sIEZhdW5hIQ==")

The method returns an FQL Bytes value:

Bytes("SGVsbG8sIEZhdW5hIQ==")

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!