I am using mongodb java driver thru maven repository (as below in pom.xml) to query transactions between date range with aggregate framwork. The java driver generates follo
You have to format the date before passing onto $match aggregate.
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'
}
}
]);