Vous devez formater la date avant de passer à l'agrégat $match.
Order.aggregate([
{
$match: {
createdAt: {
$gte: new Date(req.body.startDate),
$lt: new Date(req.body.endDate)
}
}
},
{
$lookup: {
from: 'acbinstallerpayments',
localField: "_id",
foreignField: 'customerObjectID',
as: 'installerPaymentDetails'
}
}
]);