MongoDB $dateFromString
Convert a date string into a date value.
Use it before date arithmetic, truncation, or chronological window sorting when source data stores a timestamp as text. Production pipelines should also define error handling for uncertain input.
Expressions calculate a value inside a stage. They can read fields, compare values, perform arithmetic, or choose between two outcomes.
Course use: Beyond Hard Mode.
Example pipeline syntax
{ $dateFromString: { dateString: "$placedAt" } }