Met rawCollection kun je precies de pipeline doorgeven die je in de mongo-shell zou gebruiken.
Er is geen pakket van derden voor nodig.
const stats = await MyCollection.rawCollection() .aggregate([ {$match: {_id: 12}}, {$unwind: "$People"}, {$unwind: "$People.person"}, {$match: {"People.uuid": "123", "People.person.uuid" : "add32"}} ]) .toArray();rawCollection() geeft je de onderliggende native driver-collectie, zodat server-side aggregatieoperatoren direct werken.