Dynamic Queries for MongoDB Atlas Charts

IsoDate() is just a helper function to help you can use to create constant date values in your queries. You can also use the normal JavaScript Date() function for this purpose. I don’t see a need to use either here.

The $set pipeline stage creates a calculated field in your pipeline that can set a new value derived from other values in each document. In your case I suggested using the $dateFromString to assemble the Date-typed field since it provides options to parse the month name which you mentioned was in your data.

So I’d expect your query to look something like (note, not tested):

[
  { 
    $set: {
      parsedDate: {
        $dateFromString: {
          dateString: { $concat: [ "$makeMonth", " 01 ", "$makeYear" ] },
          format: "%b %d %Y"
        }
      }
    }
  }
]