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.

Continue reading

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.

Continue reading

How the arrayFilters Parameter Works in MongoDB

In MongoDB, when you update documents that contain arrays, you have the option of using the arrayFilters parameter.

The arrayFilters parameter allows you to specify an array of filter documents that determine which array elements to modify.

In the update document, use the $[<identifier>] filtered positional operator, which identifies the array elements that match the arrayFilters conditions for the update operation.

Continue reading