• Start

Functions

/

Database functions

Bytes

These functions can be used when working with bytes.

These functions can be used when working with bytes in SurrealQL.

Function

Description

bytes::len()

Gives the length in bytes

The bytes::len function returns the length in bytes of a bytes value.

API DEFINITION
bytes::len(bytes) -> int

The following example shows this function, and its output, when used in a RETURN statement:

/**[test]

[[test.results]]
value = "[19, 67, 25]"

*/

RETURN [
    bytes::len(<bytes>"Simple ASCII string"),
    bytes::len(<bytes>"οὐ γὰρ δυνατόν ἐστιν ἔτι καθεύδειν"),
    bytes::len(<bytes>"청춘예찬 靑春禮讚")
];
Output
[ 19, 67, 25 ]

Was this page helpful?