In MongoDB, the $month
aggregation pipeline operator returns the month of a given date as a number between 1
and 12
.
When using the $month
operator, you can optionally specify a timezone to use for the result.
The $month
operator accepts either a date (as either a Date, a Timestamp, or an ObjectId), or a document that specifies the date and timezone to use.