Snippets Collections
from human_readable.files import file_size
import os

print(file_size(value = os.stat('test.txt').st_size))
[
    {
        "$match": {
            "authorization": {
                "$ne": null
            }
        }
    },
    {
        "$match": {
            "email": {
                "$not": {
                    "$regularExpression": {
                        "pattern": "deleted",
                        "options": ""
                    }
                }
            }
        }
    },
 
    {
        "$lookup": {
            "from": "participant",
            "localField": "email",
            "foreignField": "email",
            "as": "userParticipant"
        }
    },
    {
        "$match": {}
    },
    {
        "$lookup": {
            "from": "masterSlot",
            "localField": "userParticipant._id",
            "foreignField": "navigatorId",
            "as": "slots"
        }
    },
    {
        "$lookup": {
            "from": "userCoachMapping",
            "localField": "userParticipant._id",
            "foreignField": "coachID",
            "as": "userCoachMapping"
        }
    },
    {
        "$project": {
        
            "isCoachActive": {
                "$arrayElemAt": [
                    "$userParticipant.active",
                    0
                ]
            },
        
            "email": {
                "$arrayElemAt": [
                    "$userParticipant.email",
                    0
                ]
            },
            "firstName": {
                "$arrayElemAt": [
                    "$userParticipant.firstName",
                    0
                ]
            },
            "coachProfileDescription": {
                "$arrayElemAt": [
                    "$userParticipant.coachProfileDescription",
                    0
                ]
            },
    
            "middleName": {
                "$arrayElemAt": [
                    "$userParticipant.middleName",
                    0
                ]
            },
            "lastName": {
                "$arrayElemAt": [
                    "$userParticipant.lastName",
                    0
                ]
            },
            "partnerShortCode": {
                "$arrayElemAt": [
                    "$userParticipant.partnerShortCode",
                    0
                ]
            },
    
            "role": {
                "$arrayElemAt": [
                    "$userParticipant.role",
                    0
                ]
            },
            "templateName": "$authorization.name",
            "servicePartnerShortCode": "$servicePartnerShortCode",
            "userVisibility": "$userVisibility",
    
            "Total Users": {
                "$size": {
                    "$filter": {
                        "input": "$userCoachMapping",
                        "as": "coach",
                        "cond": { "$eq": ["$$coach.userStatus", "ACTIVE"] }
                    }
                }
            }
            _id:0
        }
    },
    {
        $match:{
            "Total Users": { "$gt": 0 }
        }
    }
]
100% scale use CTRL+1 or CMD+1
75% scale use CTRL+2 or CMD+2
50% scale use CTRL+3 or CMD+3
33% scale use CTRL+4 or CMD+4
25% scale use CTRL+5 or CMD+5
star

Thu Apr 25 2024 04:12:30 GMT+0000 (Coordinated Universal Time) http://34.74.16.180:3000/question#eyJkYXRhc2V0X3F1ZXJ5Ijp7InR5cGUiOiJuYXRpdmUiLCJuYXRpdmUiOnsiY29sbGVjdGlvbiI6InVzZXJzIiwicXVlcnkiOiJbXHJcbiAgICB7XHJcbiAgICAgICAgXCIkbWF0Y2hcIjoge1xyXG4gICAgICAgICAgICBcImF1dGhvcml6YXRpb25cIjoge1xyXG4gICAgICAgICAgICAgICAgXCIkbmVcIjogbnVsbFxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfSxcclxuICAgIHtcclxuICAgICAgICBcIiRtYXRjaFwiOiB7XHJcbiAgICAgICAgICAgIFwiZW1haWxcIjoge1xyXG4gICAgICAgICAgICAgICAgXCIkbm90XCI6IHtcclxuICAgICAgICAgICAgICAgICAgICBcIiRyZWd1bGFyRXhwcmVzc2lvblwiOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIFwicGF0dGVyblwiOiBcImRlbGV0ZWRcIixcclxuICAgICAgICAgICAgICAgICAgICAgICAgXCJvcHRpb25zXCI6IFwiXCJcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9LFxyXG4gXHJcbiAgICB7XHJcbiAgICAgICAgXCIkbG9va3VwXCI6IHtcclxuICAgICAgICAgICAgXCJmcm9tXCI6IFwicGFydGljaXBhbnRcIixcclxuICAgICAgICAgICAgXCJsb2NhbEZpZWxkXCI6IFwiZW1haWxcIixcclxuICAgICAgICAgICAgXCJmb3JlaWduRmllbGRcIjogXCJlbWFpbFwiLFxyXG4gICAgICAgICAgICBcImFzXCI6IFwidXNlclBhcnRpY2lwYW50XCJcclxuICAgICAgICB9XHJcbiAgICB9LFxyXG4gICAge1xyXG4gICAgICAgIFwiJG1hdGNoXCI6IHt9XHJcbiAgICB9LFxyXG4gICAge1xyXG4gICAgICAgIFwiJGxvb2t1cFwiOiB7XHJcbiAgICAgICAgICAgIFwiZnJvbVwiOiBcIm1hc3RlclNsb3RcIixcclxuICAgICAgICAgICAgXCJsb2NhbEZpZWxkXCI6IFwidXNlclBhcnRpY2lwYW50Ll9pZFwiLFxyXG4gICAgICAgICAgICBcImZvcmVpZ25GaWVsZFwiOiBcIm5hdmlnYXRvcklkXCIsXHJcbiAgICAgICAgICAgIFwiYXNcIjogXCJzbG90c1wiXHJcbiAgICAgICAgfVxyXG4gICAgfSxcclxuICAgIHtcclxuICAgICAgICBcIiRsb29rdXBcIjoge1xyXG4gICAgICAgICAgICBcImZyb21cIjogXCJ1c2VyQ29hY2hNYXBwaW5nXCIsXHJcbiAgICAgICAgICAgIFwibG9jYWxGaWVsZFwiOiBcInVzZXJQYXJ0aWNpcGFudC5faWRcIixcclxuICAgICAgICAgICAgXCJmb3JlaWduRmllbGRcIjogXCJjb2FjaElEXCIsXHJcbiAgICAgICAgICAgIFwiYXNcIjogXCJ1c2VyQ29hY2hNYXBwaW5nXCJcclxuICAgICAgICB9XHJcbiAgICB9LFxyXG4gICAge1xyXG4gICAgICAgIFwiJHByb2plY3RcIjoge1xyXG4gICAgICAgIFxyXG4gICAgICAgICAgICBcImlzQ29hY2hBY3RpdmVcIjoge1xyXG4gICAgICAgICAgICAgICAgXCIkYXJyYXlFbGVtQXRcIjogW1xyXG4gICAgICAgICAgICAgICAgICAgIFwiJHVzZXJQYXJ0aWNpcGFudC5hY3RpdmVcIixcclxuICAgICAgICAgICAgICAgICAgICAwXHJcbiAgICAgICAgICAgICAgICBdXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgXHJcbiAgICAgICAgICAgIFwiZW1haWxcIjoge1xyXG4gICAgICAgICAgICAgICAgXCIkYXJyYXlFbGVtQXRcIjogW1xyXG4gICAgICAgICAgICAgICAgICAgIFwiJHVzZXJQYXJ0aWNpcGFudC5lbWFpbFwiLFxyXG4gICAgICAgICAgICAgICAgICAgIDBcclxuICAgICAgICAgICAgICAgIF1cclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgXCJmaXJzdE5hbWVcIjoge1xyXG4gICAgICAgICAgICAgICAgXCIkYXJyYXlFbGVtQXRcIjogW1xyXG4gICAgICAgICAgICAgICAgICAgIFwiJHVzZXJQYXJ0aWNpcGFudC5maXJzdE5hbWVcIixcclxuICAgICAgICAgICAgICAgICAgICAwXHJcbiAgICAgICAgICAgICAgICBdXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIFwiY29hY2hQcm9maWxlRGVzY3JpcHRpb25cIjoge1xyXG4gICAgICAgICAgICAgICAgXCIkYXJyYXlFbGVtQXRcIjogW1xyXG4gICAgICAgICAgICAgICAgICAgIFwiJHVzZXJQYXJ0aWNpcGFudC5jb2FjaFByb2ZpbGVEZXNjcmlwdGlvblwiLFxyXG4gICAgICAgICAgICAgICAgICAgIDBcclxuICAgICAgICAgICAgICAgIF1cclxuICAgICAgICAgICAgfSxcclxuICAgIFxyXG4gICAgICAgICAgICBcIm1pZGRsZU5hbWVcIjoge1xyXG4gICAgICAgICAgICAgICAgXCIkYXJyYXlFbGVtQXRcIjogW1xyXG4gICAgICAgICAgICAgICAgICAgIFwiJHVzZXJQYXJ0aWNpcGFudC5taWRkbGVOYW1lXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgMFxyXG4gICAgICAgICAgICAgICAgXVxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBcImxhc3ROYW1lXCI6IHtcclxuICAgICAgICAgICAgICAgIFwiJGFycmF5RWxlbUF0XCI6IFtcclxuICAgICAgICAgICAgICAgICAgICBcIiR1c2VyUGFydGljaXBhbnQubGFzdE5hbWVcIixcclxuICAgICAgICAgICAgICAgICAgICAwXHJcbiAgICAgICAgICAgICAgICBdXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIFwicGFydG5lclNob3J0Q29kZVwiOiB7XHJcbiAgICAgICAgICAgICAgICBcIiRhcnJheUVsZW1BdFwiOiBbXHJcbiAgICAgICAgICAgICAgICAgICAgXCIkdXNlclBhcnRpY2lwYW50LnBhcnRuZXJTaG9ydENvZGVcIixcclxuICAgICAgICAgICAgICAgICAgICAwXHJcbiAgICAgICAgICAgICAgICBdXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICBcclxuICAgICAgICAgICAgXCJyb2xlXCI6IHtcclxuICAgICAgICAgICAgICAgIFwiJGFycmF5RWxlbUF0XCI6IFtcclxuICAgICAgICAgICAgICAgICAgICBcIiR1c2VyUGFydGljaXBhbnQucm9sZVwiLFxyXG4gICAgICAgICAgICAgICAgICAgIDBcclxuICAgICAgICAgICAgICAgIF1cclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgXCJ0ZW1wbGF0ZU5hbWVcIjogXCIkYXV0aG9yaXphdGlvbi5uYW1lXCIsXHJcbiAgICAgICAgICAgIFwic2VydmljZVBhcnRuZXJTaG9ydENvZGVcIjogXCIkc2VydmljZVBhcnRuZXJTaG9ydENvZGVcIixcclxuICAgICAgICAgICAgXCJ1c2VyVmlzaWJpbGl0eVwiOiBcIiR1c2VyVmlzaWJpbGl0eVwiLFxyXG4gICAgXHJcbiAgICAgICAgICAgIFwiVG90YWwgVXNlcnNcIjoge1xyXG4gICAgICAgICAgICAgICAgXCIkc2l6ZVwiOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgXCIkZmlsdGVyXCI6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgXCJpbnB1dFwiOiBcIiR1c2VyQ29hY2hNYXBwaW5nXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIFwiYXNcIjogXCJjb2FjaFwiLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBcImNvbmRcIjogeyBcIiRlcVwiOiBbXCIkJGNvYWNoLnVzZXJTdGF0dXNcIiwgXCJBQ1RJVkVcIl0gfVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBfaWQ6MFxyXG4gICAgICAgIH1cclxuICAgIH0sXHJcbiAgICB7XHJcbiAgICAgICAgJG1hdGNoOntcclxuICAgICAgICAgICAgXCJUb3RhbCBVc2Vyc1wiOiB7IFwiJGd0XCI6IDAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuXSIsInRlbXBsYXRlLXRhZ3MiOnt9fSwiZGF0YWJhc2UiOjJ9LCJkaXNwbGF5IjoidGFibGUiLCJ2aXN1YWxpemF0aW9uX3NldHRpbmdzIjp7fX0=

#aggregation #mongodb #map #filter #size
star

Mon Jan 17 2022 10:24:31 GMT+0000 (Coordinated Universal Time)

#ios #swift #xcode #simulator #size

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension