Select a panel date from a native query mongodb

Hello friends
I need help. I made the following native query using mongodb:

[
    {
    "$match": {
        "$and": [
        {
            "$or": [{
                "stages_pre.approach": {
                    "$gte": ISODate("2019-06-28")
                }
            }]
        },
        {
            "$or": [
                
                {
                    "pipedrive.current.11cf43618f9564ade3b4226067a367a7a39de648": "145"
                },
                {
                    "pipedrive.current.11cf43618f9564ade3b4226067a367a7a39de648": "290"
                },
                {
                    "pipedrive.current.11cf43618f9564ade3b4226067a367a7a39de648": "320"
                },
                {
                    "pipedrive.current.11cf43618f9564ade3b4226067a367a7a39de648": "321"
                }
            ],
            "$nor": [
                {
                    "pipedrive.current.status": "deleted"
                }
            ]
        }
    ]
    }
},{
    "$group": {
        "_id": null,
        "count": {
            "$sum": 1
        }
    }
},{
    "$sort": {
        "_id": 1
    }
},{
    "$project": {
        "_id": false,
        "count": true
    }
}]

"$gte": ISODate(“2019-06-28”)

I need the date to make it dynamic on the panel

When you select the date on the panel, the query result appears.
Can anyone help me?

Hi @saulolago
Metabase does not currently allow filter variables with MongoDB:
https://github.com/metabase/metabase/issues/3653 - go upvote by clicking :+1: on the first post