Query JSON with SQL and component value

This query works, of course:
select * from {{mongo_group.data['0'].result}} ORDER BY 'count' LIMIT 50

If I replace the limit value with a component value, no result comes up:

select * from {{mongo_group.data['0'].result}} ORDER BY 'count' LIMIT {{select_count_hosts.value}}

or

select * from {{mongo_group.data['0'].result}} ORDER BY 'count' LIMIT {{parseInt(select_count_hosts.value)}}

What am I doing wrong?

count should not be in single quotes but you may want to read about AlaSQL Limit · AlaSQL/alasql Wiki · GitHub

Since "count" is a column, it must be enclosed in quotation marks. Otherwise it will be treated as a keyword.
The limit call is also logical for me.

Only why can't I include a variable?

Hey @Rainer! It looks like this is an underlying issue with AlaSQL, would it be possible to limit the results of your query with a JS transformer since the data has already been brought into your frontend?