Simple, self-explanatory code snippets.
db.collection_name.aggregate([
{$addFields: {
list: {$filter: {
input: '$array_field_name',
as: 'item',
cond: {
$gt: [
'$$item.array_subfield_name',
value
]
}
}}
]);
No comments:
Post a Comment