Hi Folks, I am not sure what is issue with my date match statement. If I put this in my aggregation pipeline, not able to get any result.
[
{
$match: {
creationDate: {
$ne: "",
}
}
},
{
$addFields: {
created_at: {
$toDate: "$creationDate",
},
current_date: {
$toDate: "$$NOW",
},
threshholdDate:{$subtract: [ "$$NOW", 7*30*24*60*60*1000 ]
},
},
},
{
**$match:{**
** "created_at":{$gt:{$subtract: [ "$$NOW", 7*30*24*60*60*1000 ]}}**
**},**
},
{
$project: {
_id: "$_id",
created_at:"$created_at",
creationDate:"$creationDate",
current_date:"$current_date",
threshholdDate:"$threshholdDate",
},
},
]