Filters not working in Dashboard

I have a dashboard in which , some question created in native query and some questions through GUI, Filters not working for native query questions. Is there any way to resolve that. These Native questions written in Mongo that's why I can't even use again to create in GUI.
Please suggests a solution for this.

Post "Diagnostic Info" from Admin > Troubleshooting.
If you're not using the latest release, then try upgrading first: https://github.com/metabase/metabase/releases/latest

{
"browser-info": {
"language": "en-GB",
"platform": "MacIntel",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.12+7",
"java.vendor": "Eclipse Foundation",
"java.vendor.url": "https://adoptium.net/",
"java.version": "11.0.12",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.12+7",
"os.name": "Linux",
"os.version": "5.4.0-1057-aws",
"user.language": "en",
"user.timezone": "GMT"
},
"metabase-info": {
"databases": [
"h2",
"postgres",
"mongo"
],
"hosting-env": "unknown",
"application-database": "postgres",
"application-database-details": {
"database": {
"name": "PostgreSQL",
"version": "12.7"
},
"jdbc-driver": {
"name": "PostgreSQL JDBC Driver",
"version": "42.2.18"
}
},
"run-mode": "prod",
"version": {
"date": "2021-09-09",
"tag": "v0.40.4",
"branch": "release-x.40.x",
"hash": "16d2e53"
},
"settings": {
"report-timezone": "Asia/Calcutta"
}
}
}

@varnika You need to add variables to Native queries to be able to use filters: https://www.metabase.com/docs/latest/users-guide/13-sql-parameters.html

You should upgrade to 0.40.5 - latest release is 0.41.1 - https://github.com/metabase/metabase/releases

yes, I also think of that solution but unable to set variables by using "{{}}" in mongodb code.
Can you please help me, I am attaching my code here and want to set created_at as variable.

Thanks in advance.

[
    {$sort: {created_at:-1}},
    {$group: {_id: "$linkedin_response.id",linkedin_response:{$first: "$linkedin_response"},total_score:{$first: "$total_score"}, created_at: {$first: "$created_at"}}},
    { "$addFields": {
        "linkedin_created_at": {
            "$convert": {
                "input": "$linkedin_response.created_at",
                "to": "date"
            }
        }
    } },
    {$match: {
        "linkedin_created_at": {
            "$exists": true,
        },
        "linkedin_response.is_poi": {
            "$eq": true,
        },
        "linkedin_response.archive": {
            "$eq": false,
        }
    }},
  {"$group":{"_id":{"linkedin_created_at~~~week":{"$let":{"vars":{"parts":{"$dateToParts":{"date":{"$subtract":["$linkedin_created_at",{"$multiply":[{"$subtract":[{"$let":{"vars":{"day_of_week":{"$mod":[{"$add":[{"$dayOfWeek":"$linkedin_created_at"},0]},7]}},"in":{"$cond":{"if":{"$eq":["$$day_of_week",0]},"then":7,"else":"$$day_of_week"}}}},2]},86400000]}]}}}},"in":{"$dateFromParts":{"year":"$$parts.year","month":"$$parts.month","day":"$$parts.day"}}}}},
    "sum":{"$sum":"$total_score"},
    "count":{"$sum":1},
    }},
    {"$sort":{"_id":1}},
    { "$group": {
    "_id": null,
    "docs": { "$push": "$$ROOT" },
  }},
  { "$addFields": {
    "docs": {
      "$map": {
        "input": { "$range": [ 0, { "$size": "$docs" } ] },
        "in": {
          "$mergeObjects": [
            { "$arrayElemAt": [ "$docs", "$$this" ] },
            { "sum": { 
              "$sum": { 
                "$slice": [ "$docs.sum", 0, { "$add": [ "$$this", 1 ] } ]
              }
            }},
            { "count": { 
              "$sum": { 
                "$slice": [ "$docs.count", 0, { "$add": [ "$$this", 1 ] } ]
              }
            }}
          ]
        }
      }
    }
  }},
  { "$unwind": "$docs" },
  { "$replaceRoot": { "newRoot": "$docs" } }

    
    {"$project":{"_id":false,"linkedin_created_at~~~week":"$_id.linkedin_created_at~~~week",
   
    "divide" :{$round:[ {"$divide" :["$sum", "$count"]},0]},
    }},{"$sort":{"linkedin_created_at~~~week":1}}
]

@varnika Try making a query in the GUI with a filter, and then convert to Native query. It's much easier to learn from looking at real examples.
Why are you "unable to set variables"?