db.collection_name.aggregate([
{$match: {
"array_of_objects": {
$elemMatch: {
"object_property_1": value_1,
"object_property_2": value_2
}
}
}},
]);
db.collection_name.aggregate([
{$match: {
"array_of_objects": {
$elemMatch: {
"object_property_1": value_1,
"object_property_2": value_2
}
}
}},
]);
db.collection_name.aggregate([
{$match: {
$nor: [
{"array_of_objects": {
$elemMatch: {
"object_property_1": value_1,
"object_property_2": value_2
}
}}
]
}},
]);
db.collection_name.aggregate([
{$addFields: {
list: {$filter: {
input: '$array_field_name',
as: 'item',
cond: {
$gt: [
'$$item.array_subfield_name',
value
]
}
}}
}}
]);