Am looking for a way to use aggregation expressions within the query language.
e.g this is my aggregation
Locations.aggregate([
{ "$match": { "name": "development" } },
{
"$lookup": {
"from": "users",
"localField": "followers",
"foreignField": "_id",
"as": "followers"
}
}
])
How can we turn it into a find
like
Locations.find( ...aggregation goes here )
PS: I've researched on $expr
but there's nowhere it shows how to add the $lookup
or $match
into it.