I want to make filtering for custom native query on mongo, and the filter is supposed to be boolean.
[
{ $match: { covid_related: {{covid_related}} } },
{"$project": { "covid_related":"$covid_related","country":"$country"}}
]
When I pass true from the filter it gives me there is no results.
I tried toBool to be sure it's converting text to boolean, but same issue
{ $match: { covid_related: { $toBool: {{covid_related}} } }},
Also it returns no results.
But when I manually write true in the match it works.
{ $match: { covid_related: true }},
it returns data.
Can u plz explain what I am missing?
Thank yoou