📅  最后修改于: 2022-03-11 14:56:24.448000             🧑  作者: Mango
db.test.aggregate([
{$match: {'shapes.color': 'red'}},
{$project: {
shapes: {$filter: {
input: '$shapes',
as: 'shape',
cond: {$eq: ['$$shape.color', 'red']}
}},
_id: 0
}}
])