Why native query is not what mongodb console is?

I can't convert this query to native query. I don't understand how it works

var gteNow={$gte : new Date()}
var userLookup={
    "localField": "shopinfo.user_ids",
    "from": "users",
    "foreignField": "_id",
    "as": "userinfo"
}
var shopLookup={
    "localField": "shop_id",
    "from": "shops",
    "foreignField": "_id",
    "as": "shopinfo"
}
db.subscriptions.aggregate([
     {"$match":{expired_at: gteNow}},
     { "$lookup": shopLookup},
     {"$unwind":"$shopinfo"},
     {"$unwind":"$shopinfo.user_ids"},
     { "$lookup": userLookup},
     {"$unwind":"$userinfo"},
])

Hi @hadifarnoud
Metabase does not support all the functionality of the MongoDB console.
And $lookup is currently not supported:
https://github.com/metabase/metabase/issues/9095 - upvote by clicking :+1: on the first post