In MongoDB, the $dayOfWeek
aggregation pipeline operator returns the day of the week for a date as a number between 1
(Sunday) and 7
(Saturday).
You can optionally specify a timezone to use for the result.
The $dayOfWeek
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.