Date condition gives no result

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",
    },
  },
]

Please provide sample documents that are supposed to match so that we can experiment your pipeline with your data.

{“_id”:{“$oid”:“626d23f536c7598296034d67”},“orderNumber”:“59151015”,“isorderNumber”:null,“orderTotal”:{“value”:“159.00”,“currency”:“USD”},“creationDate”:“11/10/2021”,“orderStartDate”:“11/10/2021”,“status”:“Shipped”,“payment”:{“paymentMethod”:“N30”,“accountIdentifier”:“”},“invoiceToAddress”:{“addressLine1”:“501 NIGHTINGALE AVE”,“addressLine2”:“”,“city”:“LONDON”,“companyName1”:“”,“country”:“ON”,“countryCode”:“CA”,“email”:“”,“fax”:“”,“firstName”:“”,“lastName”:“”,“mainDivision”:“”,“mainDivisionCode”:“”,“phoneHome”:“”,“postalCode”:“N5W4C4”},“shipToAddress”:{“addressLine1”:“501 NIGHTINGALE AVE”,“addressLine2”:null,“addressLine3”:null,“storeId”:“”,“city”:“LONDON”,“companyName1”:“”,“country”:“CA”,“countryCode”:“CA”,“fax”:“”,“firstName”:“”,“lastName”:“”,“mainDivision”:“”,“mainDivisionCode”:“”,“phoneHome”:“”,“postalCode”:“N5W4C4”},“commonShippingMethod”:{“shippingDesc”:“UPS GROUND”,“shippingCode”:“UPS”},“lineItems”:[{“name”:“3PKT MOCK WRAP ORIGINAL TOP”,“sku”:“415323”,“styleColor”:“415323”,“style”:“4153”,“color”:“23”,“totalOrdered”:“1”,“totalOpen”:“0”,“totalShipped”:“1”,“totalCanceled”:“0”,“unitPrice”:{“currency”:“USD”,“value”:“13.00”},“totalPrice”:{“currency”:“USD”,“value”:“13.00”},“shippedLines”:[{“size”:“S”,“ordered”:{“$numberInt”:“1”},“open”:{“$numberInt”:“0”},“totalShippedQty”:{“$numberInt”:“1”},“canceled”:{“$numberInt”:“0”}}]},{“name”:“5PKT SOFT RIB WAIST JOGGER”,“sku”:“GRSP53701”,“styleColor”:“GRSP53701”,“style”:“GRSP537”,“color”:“01”,“totalOrdered”:“1”,“totalOpen”:“0”,“totalShipped”:“1”,“totalCanceled”:“0”,“unitPrice”:{“currency”:“USD”,“value”:“15.50”},“totalPrice”:{“currency”:“USD”,“value”:“15.50”},“shippedLines”:[{“canceled”:{“$numberInt”:“0”},“size”:“S”,“ordered”:{“$numberInt”:“1”},“open”:{“$numberInt”:“0”},“totalShippedQty”:{“$numberInt”:“1”}}]},{“name”:“34" 4PKT ROUNDED COLLAR BELT L”,“sku”:“448110”,“styleColor”:“448110”,“style”:“4481”,“color”:“10”,“totalOrdered”:“2”,“totalOpen”:“0”,“totalShipped”:“2”,“totalCanceled”:“0”,“unitPrice”:{“currency”:“USD”,“value”:“20.00”},“totalPrice”:{“currency”:“USD”,“value”:“40.00”},“shippedLines”:[{“ordered”:{“$numberInt”:“1”},“open”:{“$numberInt”:“0”},“totalShippedQty”:{“$numberInt”:“1”},“canceled”:{“$numberInt”:“0”},“size”:“L”},{“open”:{“$numberInt”:“0”},“totalShippedQty”:{“$numberInt”:“1”},“canceled”:{“$numberInt”:“0”},“size”:“M”,“ordered”:{“$numberInt”:“1”}}]},{“name”:“6PKT TIE FRONT CARGO PANT”,“sku”:“4277503”,“styleColor”:“4277503”,“style”:“4277”,“color”:“503”,“totalOrdered”:“1”,“totalOpen”:“0”,“totalShipped”:“1”,“totalCanceled”:“0”,“unitPrice”:{“currency”:“USD”,“value”:“17.00”},“totalPrice”:{“currency”:“USD”,“value”:“17.00”},“shippedLines”:[{“size”:“XL”,“ordered”:{“$numberInt”:“1”},“open”:{“$numberInt”:“0”},“totalShippedQty”:{“$numberInt”:“1”},“canceled”:{“$numberInt”:“0”}}]},{“name”:“2 PKT V-NECK SHIRRED BACK”,“sku”:“71166503”,“styleColor”:“71166503”,“style”:“71166”,“color”:“503”,“totalOrdered”:“2”,“totalOpen”:“0”,“totalShipped”:“2”,“totalCanceled”:“0”,“unitPrice”:{“currency”:“USD”,“value”:“12.50”},“totalPrice”:{“currency”:“USD”,“value”:“25.00”},“shippedLines”:[{“size”:“XL”,“ordered”:{“$numberInt”:“2”},“open”:{“$numberInt”:“0”},“totalShippedQty”:{“$numberInt”:“2”},“canceled”:{“$numberInt”:“0”}}]},{“name”:“3PKT VITALITY LOGO ELASTIC”,“sku”:“SK20241”,“styleColor”:“SK20241”,“style”:“SK202”,“color”:“41”,“totalOrdered”:“2”,“totalOpen”:“0”,“totalShipped”:“2”,“totalCanceled”:“0”,“unitPrice”:{“currency”:“USD”,“value”:“11.00”},“totalPrice”:{“currency”:“USD”,“value”:“22.00”},“shippedLines”:[{“totalShippedQty”:{“$numberInt”:“1”},“canceled”:{“$numberInt”:“0”},“size”:“XXS”,“ordered”:{“$numberInt”:“1”},“open”:{“$numberInt”:“0”}},{“ordered”:{“$numberInt”:“1”},“open”:{“$numberInt”:“0”},“totalShippedQty”:{“$numberInt”:“1”},“canceled”:{“$numberInt”:“0”},“size”:“S”}]},{“name”:“3PKT VITALITY LOGO ELASTIC”,“sku”:“SK20201”,“styleColor”:“SK20201”,“style”:“SK202”,“color”:“01”,“totalOrdered”:“1”,“totalOpen”:“0”,“totalShipped”:“1”,“totalCanceled”:“0”,“unitPrice”:{“currency”:“USD”,“value”:“11.00”},“totalPrice”:{“currency”:“USD”,“value”:“11.00”},“shippedLines”:[{“size”:“XS”,“ordered”:{“$numberInt”:“1”},“open”:{“$numberInt”:“0”},“totalShippedQty”:{“$numberInt”:“1”},“canceled”:{“$numberInt”:“0”}}]},{“name”:“5PKT SOFT RIB WAIST JOGGER”,“sku”:“GRSP53723”,“styleColor”:“GRSP53723”,“style”:“GRSP537”,“color”:“23”,“totalOrdered”:“1”,“totalOpen”:“0”,“totalShipped”:“1”,“totalCanceled”:“0”,“unitPrice”:{“currency”:“USD”,“value”:“15.50”},“totalPrice”:{“currency”:“USD”,“value”:“15.50”},“shippedLines”:[{“size”:“S”,“ordered”:{“$numberInt”:“1”},“open”:{“$numberInt”:“0”},“totalShippedQty”:{“$numberInt”:“1”},“canceled”:{“$numberInt”:“0”}}]}],“totals”:{“grandTotal”:{“currency”:“USD”,“value”:“159.00”},“subTotal”:{“currency”:“USD”,“value”:“159.00”},“shippingTotal”:{“currency”:“USD”,“value”:“40.51”},“taxTotals”:{“currency”:“USD”,“value”:“25.95”}},“shippingDetails”:[{“shipmentTracking”:“1Z51XW206866486539”,“shipTrackingURL”:“Tracking | UPS - United States”}

Please read Formatting code and log snippets in posts and update your sample documents so that we can cut-n-paste directly into our system.

{"_id":{"$oid":“626d23f536c7598296034d67”},“orderNumber”:“59151015”,“isorderNumber”:null,“orderTotal”:{“value”:“159.00”,“currency”:“USD”},“creationDate”:“11/10/2021”,“orderStartDate”:“11/10/2021”,“status”:“Shipped”,“payment”:{“paymentMethod”:“N30”,“accountIdentifier”:""},“invoiceToAddress”:{“addressLine1”:“501 NIGHTINGALE AVE”,“addressLine2”:"",“city”:“LONDON”,“companyName1”:"",“country”:“ON”,“countryCode”:“CA”,“email”:"",“fax”:"",“firstName”:"",“lastName”:"",“mainDivision”:"",“mainDivisionCode”:"",“phoneHome”:"",“postalCode”:“N5W4C4”},“shipToAddress”:{“addressLine1”:“501 NIGHTINGALE AVE”,“addressLine2”:null,“addressLine3”:null,“storeId”:"",“city”:“LONDON”,“companyName1”:"",“country”:“CA”,“countryCode”:“CA”,“fax”:"",“firstName”:"",“lastName”:"",“mainDivision”:"",“mainDivisionCode”:"",“phoneHome”:"",“postalCode”:“N5W4C4”},“commonShippingMethod”:{“shippingDesc”:“UPS GROUND”,“shippingCode”:“UPS”},“lineItems”:[{“name”:“3PKT MOCK WRAP ORIGINAL TOP”,“sku”:“415323”,“styleColor”:“415323”,“style”:“4153”,“color”:“23”,“totalOrdered”:“1”,“totalOpen”:“0”,“totalShipped”:“1”,“totalCanceled”:“0”,“unitPrice”:{“currency”:“USD”,“value”:“13.00”},“totalPrice”:{“currency”:“USD”,“value”:“13.00”},“shippedLines”:[{“size”:“S”,“ordered”:{"$numberInt":“1”},“open”:{"$numberInt":“0”},“totalShippedQty”:{"$numberInt":“1”},“canceled”:{"$numberInt":“0”}}]},{“name”:“5PKT SOFT RIB WAIST JOGGER”,“sku”:“GRSP53701”,“styleColor”:“GRSP53701”,“style”:“GRSP537”,“color”:“01”,“totalOrdered”:“1”,“totalOpen”:“0”,“totalShipped”:“1”,“totalCanceled”:“0”,“unitPrice”:{“currency”:“USD”,“value”:“15.50”},“totalPrice”:{“currency”:“USD”,“value”:“15.50”},“shippedLines”:[{“canceled”:{"$numberInt":“0”},“size”:“S”,“ordered”:{"$numberInt":“1”},“open”:{"$numberInt":“0”},“totalShippedQty”:{"$numberInt":“1”}}]},{“name”:“34” 4PKT ROUNDED COLLAR BELT L",“sku”:“448110”,“styleColor”:“448110”,“style”:“4481”,“color”:“10”,“totalOrdered”:“2”,“totalOpen”:“0”,“totalShipped”:“2”,“totalCanceled”:“0”,“unitPrice”:{“currency”:“USD”,“value”:“20.00”},“totalPrice”:{“currency”:“USD”,“value”:“40.00”},“shippedLines”:[{“ordered”:{"$numberInt":“1”},“open”:{"$numberInt":“0”},“totalShippedQty”:{"$numberInt":“1”},“canceled”:{"$numberInt":“0”},“size”:“L”},{“open”:{"$numberInt":“0”},“totalShippedQty”:{"$numberInt":“1”},“canceled”:{"$numberInt":“0”},“size”:“M”,“ordered”:{"$numberInt":“1”}}]},{“name”:“6PKT TIE FRONT CARGO PANT”,“sku”:“4277503”,“styleColor”:“4277503”,“style”:“4277”,“color”:“503”,“totalOrdered”:“1”,“totalOpen”:“0”,“totalShipped”:“1”,“totalCanceled”:“0”,“unitPrice”:{“currency”:“USD”,“value”:“17.00”},“totalPrice”:{“currency”:“USD”,“value”:“17.00”},“shippedLines”:[{“size”:“XL”,“ordered”:{"$numberInt":“1”},“open”:{"$numberInt":“0”},“totalShippedQty”:{"$numberInt":“1”},“canceled”:{"$numberInt":“0”}}]},{“name”:“2 PKT V-NECK SHIRRED BACK”,“sku”:“71166503”,“styleColor”:“71166503”,“style”:“71166”,“color”:“503”,“totalOrdered”:“2”,“totalOpen”:“0”,“totalShipped”:“2”,“totalCanceled”:“0”,“unitPrice”:{“currency”:“USD”,“value”:“12.50”},“totalPrice”:{“currency”:“USD”,“value”:“25.00”},“shippedLines”:[{“size”:“XL”,“ordered”:{"$numberInt":“2”},“open”:{"$numberInt":“0”},“totalShippedQty”:{"$numberInt":“2”},“canceled”:{"$numberInt":“0”}}]},{“name”:“3PKT VITALITY LOGO ELASTIC”,“sku”:“SK20241”,“styleColor”:“SK20241”,“style”:“SK202”,“color”:“41”,“totalOrdered”:“2”,“totalOpen”:“0”,“totalShipped”:“2”,“totalCanceled”:“0”,“unitPrice”:{“currency”:“USD”,“value”:“11.00”},“totalPrice”:{“currency”:“USD”,“value”:“22.00”},“shippedLines”:[{“totalShippedQty”:{"$numberInt":“1”},“canceled”:{"$numberInt":“0”},“size”:“XXS”,“ordered”:{"$numberInt":“1”},“open”:{"$numberInt":“0”}},{“ordered”:{"$numberInt":“1”},“open”:{"$numberInt":“0”},“totalShippedQty”:{"$numberInt":“1”},“canceled”:{"$numberInt":“0”},“size”:“S”}]},{“name”:“3PKT VITALITY LOGO ELASTIC”,“sku”:“SK20201”,“styleColor”:“SK20201”,“style”:“SK202”,“color”:“01”,“totalOrdered”:“1”,“totalOpen”:“0”,“totalShipped”:“1”,“totalCanceled”:“0”,“unitPrice”:{“currency”:“USD”,“value”:“11.00”},“totalPrice”:{“currency”:“USD”,“value”:“11.00”},“shippedLines”:[{“size”:“XS”,“ordered”:{"$numberInt":“1”},“open”:{"$numberInt":“0”},“totalShippedQty”:{"$numberInt":“1”},“canceled”:{"$numberInt":“0”}}]},{“name”:“5PKT SOFT RIB WAIST JOGGER”,“sku”:“GRSP53723”,“styleColor”:“GRSP53723”,“style”:“GRSP537”,“color”:“23”,“totalOrdered”:“1”,“totalOpen”:“0”,“totalShipped”:“1”,“totalCanceled”:“0”,“unitPrice”:{“currency”:“USD”,“value”:“15.50”},“totalPrice”:{“currency”:“USD”,“value”:“15.50”},“shippedLines”:[{“size”:“S”,“ordered”:{"$numberInt":“1”},“open”:{"$numberInt":“0”},“totalShippedQty”:{"$numberInt":“1”},“canceled”:{"$numberInt":“0”}}]}],“totals”:{“grandTotal”:{“currency”:“USD”,“value”:“159.00”},“subTotal”:{“currency”:“USD”,“value”:“159.00”},“shippingTotal”:{“currency”:“USD”,“value”:“40.51”},“taxTotals”:{“currency”:“USD”,“value”:“25.95”}},“shippingDetails”:[{“shipmentTracking”:“1Z51XW206866486539”,“shipTrackingURL”:“[Tracking | UPS - United States](https://www.ups.com/track?loc=null&tracknum=1Z51XW206866486539%22,%22shipDate%22:%2211/12/2021%22,%22shipments%22:%5B%7B%22style%22:%22GRSP537%22,%22color%22:%2223%22,%22sku%22:%22GRSP53723%22,%22size%22:%22S%22,%22qty%22:%221%22%7D,%7B%22color%22:%22503%22,%22sku%22:%2271166503%22,%22size%22:%22XL%22,%22qty%22:%222%22,%22style%22:%2271166%22%7D,%7B%22color%22:%2201%22,%22sku%22:%22GRSP53701%22,%22size%22:%22S%22,%22qty%22:%221%22,%22style%22:%22GRSP537%22%7D,%7B%22sku%22:%22SK20241%22,%22size%22:%22S%22,%22qty%22:%221%22,%22style%22:%22SK202%22,%22color%22:%2241%22%7D,%7B%22size%22:%22XS%22,%22qty%22:%221%22,%22style%22:%22SK202%22,%22color%22:%2201%22,%22sku%22:%22SK20201%22%7D,%7B%22qty%22:%221%22,%22style%22:%224277%22,%22color%22:%22503%22,%22sku%22:%224277503%22,%22size%22:%22XL%22%7D,%7B%22color%22:%2210%22,%22sku%22:%22448110%22,%22size%22:%22L%22,%22qty%22:%221%22,%22style%22:%224481%22%7D,%7B%22qty%22:%221%22,%22style%22:%22SK202%22,%22color%22:%2241%22,%22sku%22:%22SK20241%22,%22size%22:%22XXS%22%7D,%7B%22sku%22:%22448110%22,%22size%22:%22M%22,%22qty%22:%221%22,%22style%22:%224481%22,%22color%22:%2210%22%7D,%7B%22color%22:%2223%22,%22sku%22:%22415323%22,%22size%22:%22S%22,%22qty%22:%221%22,%22style%22:%224153%22%7D%5D%7D%5D,%22channelID%22:%2210%22,%22poNumber%22:%223426-1%22,%22customerID%22:%2211945%22,%22orderType%22:%22EDI)”}

I cannot cut-n-paste your sample document because the quotes are wrong.

{{
  "_id": {
    "$oid": "626d29b636c759829630367c"
  },
  "orderNumber": "6114387",
  "isorderNumber": "IS_XXXX_00088164",
  "orderTotal": {
    "value": "230.88",
    "currency": "USD"
  },
  "creationDate": "10/15/2022",
  "orderStartDate": "10/15/2022",
  "status": "Shipped",
  "payment": {
    "paymentMethod": "125",
    "accountIdentifier": ""
  },
  "invoiceToAddress": {
    "addressLine1": "17890 BLANCO ROAD",
    "addressLine2": "",
    "city": "SAN ANTONIO",
    "companyName1": "",
    "country": "TX",
    "countryCode": "US",
    "email": "",
    "fax": "",
    "firstName": "",
    "lastName": "",
    "mainDivision": "",
    "mainDivisionCode": "",
    "phoneHome": "",
    "postalCode": "78232"
  },
  "shipToAddress": {
    "addressLine1": "3825  DEWEY AVE",
    "addressLine2": null,
    "addressLine3": null,
    "storeId": "04255",
    "city": "GREECE",
    "companyName1": "",
    "country": "US",
    "countryCode": "US",
    "fax": "",
    "firstName": "",
    "lastName": "",
    "mainDivision": "",
    "mainDivisionCode": "",
    "phoneHome": "",
    "postalCode": "14616"
  },
  "commonShippingMethod": {
    "shippingDesc": "UPS GROUND",
    "shippingCode": "UPS"
  },
  "lineItems": [
    {
      "name": "WOMENS FROSTY STRIPE SS POLO",
      "sku": "WN37799",
      "styleColor": "WN37799",
      "style": "WN377",
      "color": "99",
      "totalOrdered": "3",
      "totalOpen": "0",
      "totalShipped": "3",
      "totalCanceled": "0",
      "unitPrice": {
        "currency": "USD",
        "value": "15.00"
      },
      "totalPrice": {
        "currency": "USD",
        "value": "45.00"
      },
      "shippedLines": [
        {
          "totalShippedQty": 3,
          "canceled": 0,
          "size": "XL",
          "ordered": 3,
          "open": 0
        }
      ]
    },
    {
      "name": "WOMENS FROSTY STRIPE SS POLO",
      "sku": "WN377X99",
      "styleColor": "WN377X99",
      "style": "WN377X",
      "color": "99",
      "totalOrdered": "2",
      "totalOpen": "0",
      "totalShipped": "2",
      "totalCanceled": "0",
      "unitPrice": {
        "currency": "USD",
        "value": "17.00"
      },
      "totalPrice": {
        "currency": "USD",
        "value": "34.00"
      },
      "shippedLines": [
        {
          "size": "2XL",
          "ordered": 2,
          "open": 0,
          "totalShippedQty": 2,
          "canceled": 0
        }
      ]
    },
    {
      "name": "WOMENS SPATULA SS POLO",
      "sku": "WN37941",
      "styleColor": "WN37941",
      "style": "WN379",
      "color": "41",
      "totalOrdered": "3",
      "totalOpen": "0",
      "totalShipped": "3",
      "totalCanceled": "0",
      "unitPrice": {
        "currency": "USD",
        "value": "15.00"
      },
      "totalPrice": {
        "currency": "USD",
        "value": "45.00"
      },
      "shippedLines": [
        {
          "size": "XL",
          "ordered": 3,
          "open": 0,
          "totalShippedQty": 3,
          "canceled": 0
        }
      ]
    },
    {
      "name": "WOMENS SPATULA SS POLO",
      "sku": "WN379X41",
      "styleColor": "WN379X41",
      "style": "WN379X",
      "color": "41",
      "totalOrdered": "2",
      "totalOpen": "0",
      "totalShipped": "2",
      "totalCanceled": "0",
      "unitPrice": {
        "currency": "USD",
        "value": "17.00"
      },
      "totalPrice": {
        "currency": "USD",
        "value": "34.00"
      },
      "shippedLines": [
        {
          "ordered": 2,
          "open": 0,
          "totalShippedQty": 2,
          "canceled": 0,
          "size": "2XL"
        }
      ]
    },
    {
      "name": "MENS FROSTY STRIPE SS POLO",
      "sku": "WN37699",
      "styleColor": "WN37699",
      "style": "WN376",
      "color": "99",
      "totalOrdered": "2",
      "totalOpen": "0",
      "totalShipped": "2",
      "totalCanceled": "0",
      "unitPrice": {
        "currency": "USD",
        "value": "16.00"
      },
      "totalPrice": {
        "currency": "USD",
        "value": "32.00"
      },
      "shippedLines": [
        {
          "canceled": 0,
          "size": "M",
          "ordered": 2,
          "open": 0,
          "totalShippedQty": 2
        }
      ]
    },
    {
      "name": "MENS SPATULA SS POLO",
      "sku": "WN37841",
      "styleColor": "WN37841",
      "style": "WN378",
      "color": "41",
      "totalOrdered": "2",
      "totalOpen": "0",
      "totalShipped": "2",
      "totalCanceled": "0",
      "unitPrice": {
        "currency": "USD",
        "value": "16.00"
      },
      "totalPrice": {
        "currency": "USD",
        "value": "32.00"
      },
      "shippedLines": [
        {
          "size": "M",
          "ordered": 2,
          "open": 0,
          "totalShippedQty": 2,
          "canceled": 0
        }
      ]
    }
  ],
  "totals": {
    "grandTotal": {
      "currency": "USD",
      "value": "230.88"
    },
    "subTotal": {
      "currency": "USD",
      "value": "222.00"
    },
    "shippingTotal": {
      "currency": "USD",
      "value": "0.00"
    },
    "taxTotals": {
      "currency": "USD",
      "value": "8.88"
    }
  },
  "shippingDetails": [
    {
      "shipmentTracking": "1Z12733W0354125333",
      "shipTrackingURL": "https://www.ups.com/track?loc=null&tracknum=1Z1271133W0354125333",
      "shipDate": "09/30/2022",
      "shipments": [
        {
          "qty": "2",
          "style": "WN376",
          "color": "99",
          "sku": "WN37699",
          "size": "M"
        },
        {
          "sku": "WN37799",
          "size": "XL",
          "qty": "3",
          "style": "WN377",
          "color": "99"
        },
        {
          "qty": "2",
          "style": "WN379X",
          "color": "41",
          "sku": "WN379X41",
          "size": "2XL"
        },
        {
          "sku": "WN37941",
          "size": "XL",
          "qty": "3",
          "style": "WN379",
          "color": "41"
        },
        {
          "sku": "WN377X99",
          "size": "2XL",
          "qty": "2",
          "style": "WN377X",
          "color": "99"
        },
        {
          "sku": "WN37841",
          "size": "M",
          "qty": "2",
          "style": "WN378",
          "color": "41"
        }
      ]
    }
  ],
  "channelID": "30",
  "poNumber": "W560",
  "customerID": "WF916",
  "orderType": "Web"
}}

Since your $match refers to $$NOW, you have to use the $expr syntax:

{ "$match" : { 
  "$expr" : { "$gt" : [ "$created_at" , {$subtract: [ "$$NOW" , 7*30*24*60*60*1000 ] } ] }
} }
1 Like

Or for simpler syntax:

{$match:{$expr:{$gt:["$created_at", "$threshholdDate"]}}}
1 Like