Query results
RETURN produces the value of its expression. For example, RETURN 1 produces the number 1. A FOR expression collects the values returned by its iterations into an array:
example.fql
Ferret v2
query.fql
FQL
RETURN FOR link IN [{ href: "/docs/" }, { href: "/try/" }]
RETURN link.href
result.json
output
The result is ["/docs/", "/try/"]. A loop with no matching iterations produces [].
Ferret values are encoded when the host delivers output. The CLI’s default JSON encoding represents objects and arrays directly and binary values as base64 strings. See Output for consumption and codec options in Go.