Variable as record key

Hi, need help with quite a basic problem!

simple query with record column name saved in param throws an error:

Query

foo="foo"
from(bucket: "bucket")
	|>  range(start: -10m)
	|>  filter(fn: (r) => r[foo] == "bar" )

Error:

type error 4:26-4:29: string != int

Anyone can help ?

Hello @Elrot,
Welcome. Unfortunately, that is not possible atm. Please take a look at this issue #2510.