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

MongoDB $dayOfMonth

In MongoDB, the $dayOfMonth aggregation pipeline operator returns the day of the month for a date as a number between 1 and 31.

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

The $dayOfMonth 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 $dayOfYear

In MongoDB, the $dayOfYear aggregation pipeline operator returns the day of the year for a date as a number between 1 and 366.

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

The $dayOfYear 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

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.

Read more

MongoDB $currentDate

In MongoDB, the $currentDate operator sets the value of a field to the current date.

It can be set as either a Date or a timestamp type. The default is Date.

$currentDate is an update operator, and can only be used when updating documents, not when inserting them (although it can be used in upsert operations).

Read more

MongoDB $toDate

In MongoDB, the $toDate aggregation operator converts a value to a date

$toDate takes any valid expression. If the expression can’t be converted to a date, it returns an error. If the expression is null or missing, it returns null.

Read more

MongoDB $mul

MongoDB has a $mul field update operator that allows you to multiply a value by a specific amount.

If the field doesn’t already exist, it is created and its value is set to zero (0) using the same numeric type as the multiplier.

Read more