Search code examples
getstream-io

What jinja2 template features are available in Aggregation Formats?


The documentation says aggregation rules use Jinja2 template syntax (https://getstream.io/docs/#aggregated-feeds), however many Jinja2 features don't seem to be supported and return syntax errors when trying to preview on the getstream.io aggregated feed group config screen.

For example, {{ actor|replace(":", "|") }} and {{ actor|length }} return syntax errors, but {{ actor|lower }} and {{ actor|int }} seem to work fine.

Does anyone know what subset of Jinja2 features are actually supported?


Solution

  • You can only use a very limited set of filters. For example int, lower and strftime on the time object. Next to that you can use the if, else and endif control structures.

    We're working on a complete list and will document them here: https://getstream.io/docs/#aggregated-feeds and update this SO answer accordingly.

    We hope this satisfies your needs for now.