Date as interval days

Hello,

I have two fields in my collection. One createdDate and other is riskScore. My requirement in to see risk score on day 1. Risk score on 30 days, then on 60 days and son on. I tried the following code. I am only getting interval as 1. I need chart to have points 1,31,61,91 and so on.

 {
        $add: [
          {
            $multiply: [
              {
                $trunc: {
                  $divide: [
                    {
                      $subtract: [
                        "$createdDate",
                        {
                          $min: "$createdDate"
                        }
                      ]
                    },
                    30 * 24 * 60 * 60 * 1000 // milliseconds in 30 days
                  ]
                }
              },
              30 // multiplying by 30
            ]
          },
          1
        ]
      } 

Can anyone let me know where exactly I am doing wrong.

Thanks in advance,
Sunita