show_posts.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:facebook-scrapper 作者: avihai123 项目源码 文件源码
def aggregate_post_types():
    """
    counting the types of posts.


    :return: list of dicts each one contain type name and counter
    """
    pipeline = [
             {"$group": {"_id": "$type", "count": {"$sum": 1}}},
             {"$sort": SON([("count", -1), ("_id", -1)])}
            ]
    return posts.aggregate(pipeline)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号