return await TestModel.aggregate([
{
$lookup: {
from: "customers",
localField: "customer",
foreignField: "_id",
as: "customer",
},
},
{
$match: QueryData,
},
{ $unwind: "$customer" },
{
$sort: {
createdAt: -1,
},
},{
$limit:5
}
]);