Creating Grafana Variables with MongoDB Query

I have some problems with mongodb query…

I will give an example with sql query and I want to write that with mongo db query in Grafana. Grafana supports mongo db ‘find’ and ‘aggregate’.

table name = flow , column name = level

sql query example 1 ;

select distinc level from flow

mongo db query: ?

sql query example 2 ;

select * from flow where level = ‘error’

mongo db query: ?

Thanks for your help.

version of grafana?
OS?

might the following help?

Also please provide some sample data?

Grafana Version is 8.1.3 and actually the problem is query .

this corresponds to where clause. But your question is really more Mongodb than grafana.

db.collection('planets').find({"name":"Mercury"})