What would be the equivalent of " $push: ‘$$ROOT’ " command in an aggregate query, when using the Mongo Csharp driver ? What would be the c# equivalent of the following json query (containing $push: ‘$$ROOT’) when using the mongodb csharp driver, with the fluent aggregate or linq (eventually using the new Linq3 provider) syntax:
db.getCollection('customers').aggregate(
[
{ $match:
{ $and:
[
{ RegistrationDate: { $lte: ISODate('2021-12-13T23:59:59.999Z'), $gte: ISODate('2011-11-22T00:00:00.0Z') }},
{ $or:
[
{ CountryOfResidence: 'France'},
{ CountryOfResidence: 'Spain'}
]
},
{ Age: {$gte: '40'}}
]
}
},
{ $group: { _id: '$LastName', count: { $sum: 1 }, data: { $push: '$$ROOT' } } },
{ $match: { count: { $gte: 2 } } }, { $project: { count: 0 } }
])