meln5674 / grafana-mongodb-community-plugin

Open Source Grafana Plugin for querying MongoDB
GNU Affero General Public License v3.0
130 stars 17 forks source link

Using variables as arary of numbers passes to query as array of strings #29

Open Nyakutka opened 7 months ago

Nyakutka commented 7 months ago

I'm trying to use variable "source_id" to one of my dashboards, here is an example: image P.S. I'm using toLong because some values are int32. So, we see some values in preview. After when creating a dashboard I use agg pipeline and get "No data" : image Query inspector shows me that array of response is empty: image Right here I see that agg pipeline contains array of strings: image Using manually entered values [1, 2, 3] everything works fine: image Values from agg pipeline are numbers, not strings. image

Nyakutka commented 7 months ago

Reprodused only when enebling Multi-value option in variable edit window

Nyakutka commented 7 months ago

UPD: fixed using Advanced variable format options: image https://grafana.com/docs/grafana/latest/dashboards/variables/variable-syntax/#raw