I\'m working on the following document
{
\"_id\" : 12,
\"firstName\" : \"wer\",
\"People\" : [
{
\"uuid\" : \"123\",
\"name\" : \"sugun\
By using rawCollection you can pass in the same pipeline that you've been using in your mongo shell.
There is no need to install a third-party package to do this.
const stats = await MyCollection.rawCollection()
.aggregate([
{$match: {_id: 12}},
{$unwind: "$People"},
{$unwind: "$People.person"},
{$match: {"People.uuid": "123", "People.person.uuid" : "add32"}}
])
.toArray();