In MongoDB, the $week
aggregation pipeline operator returns the week of the year for a date as a number between 0
and 53
.
When using the $week
operator, you can optionally specify a timezone to use for the result.
The $week
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.