Fauna Query Language (FQL) Reference - Fauna Documentation is the best there is. Our docs are quite well up to date. Ngram is not in there because it is too difficult to use in its current state.
This is indeed a limitation and would be a nice to have. It would be ideal to have. Feel free to open a feature request on the forum for people to vote on if there isn’t one yet. Currently the workarounds:
- hardcode an array [1,2,3,4,5,…,n] and map over that which is quite static of course and doesn’t work well in bindings. Ideally we would have a [1…n] syntax to Map over n elements
- recursive functions, which doesn’t work in bindings as you correctly noticed.
- generate a big query for multiple cases with the host language. You could relatively easily generate a function that handles the first N cases since FQL is quite composable.
I think using the NGram function is your best bet.
There is an extensive stackoverflow answer here that might help you: go - How to get documents that contain sub-string in FaunaDB - Stack Overflow