Get a timeline of published CVEs by month

I am trying to create a graph showing CVEs published by month in CTI Butler.

Right now I can create a search to return all CVEs…

RETURN LENGTH(
  FOR doc IN nvd_cve_vertex_collection
  FILTER doc.type == "vulnerability"
  RETURN doc
)
[
  255687
]

But how can I split this count into calendar months?

this search should give you what you need:

FOR doc IN nvd_cve_vertex_collection
FILTER doc.type == "vulnerability"
COLLECT yearMonth = CONCAT(DATE_YEAR(doc.created), "-", RIGHT("0" + DATE_MONTH(doc.created), 2)) WITH COUNT INTO count
RETURN { yearMonth, count }

Results look like this:

[
  {
    "yearMonth": "1988-10",
    "count": 1
  },
  {
    "yearMonth": "1988-11",
    "count": 1
  },
  {
    "yearMonth": "1989-1",
    "count": 1
  },
  {
    "yearMonth": "1989-10",
    "count": 1
  },
  {
    "yearMonth": "1989-7",
    "count": 1
  },
  {
    "yearMonth": "1990-1",
    "count": 1
  },
  {
    "yearMonth": "1990-10",
    "count": 5
  },
  {
    "yearMonth": "1990-12",
    "count": 2
  },
...