Multiple Selection Dropdown

Hello Everyone

Our company is using redash for one of our client and the database is MongoDB.
I’m facing problem while implementing Multiple Selection Dropdown on a query.
Query:
{
“collection”: “users”,
“aggregate”: [
{
“$match”: {
“companyName”: {
“$in”: [
“{{ userid }}”
]
}
}
},
{
“$project”: {
“UserId”: “$userId”,
“Name”: “$name”,
“companyName”: “$companyName”
}
}
]
}

Result: blank screen

I think the problem is your parameter userid is already wrapped in quote marks. So if you picked user id’s 1,2, and 3 the query line would show:

"companyName": { 
  "$in": ["1,2,3"]
}

Which wouldn’t work.

Remove the quotes around the userID parameter and it should work.

Thanks for responding @k4s1m , I got the solution:
Just need to remove " " from “{{ userid }}” and set property

.

Thanks to redash Support

Hi!
My pain is: for some reason if only one value selected in multiple selection dropdown, the value doesn’t wrap in quotes (I tried to set up both - single and double quotes - neither work) and this causes an error for the ClickHouse