MongoDB $millisecond

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.

Read more

MongoDB $second

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.

Read more

MongoDB $minute

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.

Read more

MongoDB $hour

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.

Read more

MongoDB $week

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.

Read more

MongoDB $year

In MongoDB, the $year aggregation pipeline operator returns the year portion of a given date.

When using the $year operator, you can optionally specify a timezone to use for the result.

The $year 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.

Read more

MongoDB $isoWeekYear

In MongoDB, the $isoWeekYear aggregation pipeline operator returns the ISO week-numbering year for a given date value. This is the year number in ISO 8601 format.

When using the $isoWeekYear operator, you can optionally specify a timezone to use for the result.

The $isoWeekYear 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.

Read more

MongoDB $isoWeek

In MongoDB, the $isoWeek aggregation pipeline operator returns the week number in ISO 8601 format, ranging from 1 to 53.

When using the $isoWeek operator, you can optionally specify a timezone to use for the result.

The $isoWeek 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.

Read more

MongoDB $isoDayOfWeek

In MongoDB, the $isoDayOfWeek aggregation pipeline operator returns the weekday number in ISO 8601 format, ranging from 1 (for Monday) to 7 (for Sunday).

You can optionally specify a timezone to use for the result.

The $isoDayOfWeek 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.

Read more

MongoDB $dayOfWeek

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.

Read more