mongodb鐨勪竴浜涙煡璇

鍒嗙粍骞朵繚鐣欏叾浣欑殑瀛楁

db.getCollection("facebook_ad_insight").aggregate([{
    $match: {
        "date_start": {
            $gt: "2020-11-02",
                        $lt: "2020-11-16"
        }
    }
}, {
    $group: {
                _id: {
                adset_id    :"$account_id"
                },
                "doc": { "$first": "$$ROOT" }
    }
},
{ "$replaceRoot": { "newRoot": "$doc" }}
])

鍒嗙粍姹囨诲姞鎺掑簭

db.getCollection("facebook_ad_insight").aggregate([{
    $match: {
        "date_start": {
            $gt: "2020-11-02"
        }
    }
}, {
    $group: {
                _id: {
                date_start:"$date_start",
              adset_id  :"adset_id"
                },
        spend: {
            $sum: { $toDouble: "$spend" }
        }
    },
    },  {$sort:{"_id.date_start":1}}
])

All posts

Other pages


Deprecated: 鏂囦欢 娌℃湁 comments.php 鐨勪富棰 鑷増鏈 3.0.0 璧峰凡寮冪敤锛屼笖娌℃湁鍙敤鐨勬浛浠c 璇峰湪鎮ㄧ殑涓婚涓寘鍚竴涓 comments.php 妯℃澘銆 in /www/wwwroot/liguoqi.site/wp-includes/functions.php on line 6078

鍙戣〃鍥炲

鎮ㄧ殑鐢靛瓙閭鍦板潃涓嶄細琚叕寮銆 蹇呭~椤瑰凡鐢 * 鏍囨敞