MongoDB Charts - Cumulative document growth over time

Hi @Thomas_Maxwell, thanks for trying out Charts!

What you’re trying to do is actually pretty complex, so don’t feel bad that you couldn’t figure it out - but the good news is that it is possible to do what you’re after.

Basically you need to do the following:

  1. Since you want to treat the _id field as a date, you need to click the “…” button next to the _id field and choose Convert Type, then choose Date.
  2. Now make sure you have a Column chart selected
  3. Drag the _id field (which should now show as a date) onto the X axis. Keep the “Binning” toggle on and choose the binning period you want (Month is the default, and seems to be what you want).
  4. Now also drag the _id field to the Y axis. Keep the default COUNT aggregation selected. The chart should now show the number of documents created each month.
  5. Finally, enable the “Compare Periods” toggle and leave the deault “Cumulative Total” option selected.

I think this should give you what you want. My example is below.

Tom

5 Likes