$filter
aggregate
の演算子
として機能する
users = User.objects(school__match={ "name": "Aukamm Elementary School" }).aggregate(
{ "$project": {
"first_name": 1,
"last_name": 1,
"schools": {
"$filter": {
"input": "$schools",
"as": "school",
"cond": { "$eq": [ "$$school.name", "Aukamm Elementary School" ] }
}
}
} }
)