In MongoDB, the $dateToString aggregation pipeline operator converts a given date object to a string.
The $dateToString operator accepts either a Date, a Timestamp, or an ObjectId.
In MongoDB, the $dateToString aggregation pipeline operator converts a given date object to a string.
The $dateToString operator accepts either a Date, a Timestamp, or an ObjectId.
The following table outlines the format specifiers that can be used with the $dateToString aggregation pipeline operator in MongoDB.
In MongoDB, the $dateFromString aggregation pipeline operator converts a date/time string to a date object.
The following table outlines the format specifiers that can be used with the $dateFromString aggregation pipeline operator in MongoDB.
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.
In MongoDB, the $millisecond aggregation pipeline operator returns the millisecond portion of a date as an integer between 0 and 999.
You can optionally specify a timezone to use for the result.
The $millisecond 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.
In MongoDB, the $second aggregation pipeline operator returns the second portion of a date as a number between 0 and 59. The value can also be 60 to account for leap seconds whenever applicable.
You can optionally specify a timezone to use for the result.
The $second 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.
In MongoDB, the $minute aggregation pipeline operator returns the minute portion of a date as a number between 0 and 59.
You can optionally specify a timezone to use for the result.
The $minute 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.
In MongoDB, the $hour aggregation pipeline operator returns the hour portion of a date as a number between 0 and 23.
You can optionally specify a timezone to use for the result.
The $hour 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.
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.