How to combine filer and sortArray on stage project

hi guys, i want to make some projection on specific field, but inside the projection i want also make a filter based on some condition and make sort.
this is my experiment

        data = await coll.aggregate(
            [
                {"$match": match},
                {
                    "$project": {
                        "companyId": 1,
                        "branchOfficeId": 1,
                        "serviceScheduleId": 1,
                        "serviceId": 1,
                        "queue": {
                            "$filter": {
                                "input": "$queue",
                                "cond": {
                                    "$and": [
                                        {"$eq": ["$$this.checkinTime", None]},
                                        {"$eq": ["$$this.queueType", "online"]},
                                        {"$eq": ["$$this.user.status", "waiting"]},
                                    ]
                                },
                            },
                            "$sortArray": {
                                "input": "$queue",
                                "sortBy": {"user.ticketInt": -1},
                            },
                        },
                    }
                },
            ]
        ).to_list(None)

how to combine filer and sortArray on stage project