dayOfWeekUS
Returns the day of the week for a date as a number between 1 (Sunday) and 7 (Saturday).
To use ISO 8601 day-of-week numbering (1 for Monday to 7 for Sunday), see dayOfWeekISO.
The accepted date types are Instant, ObjectId and Timestamp.
Example
class User(
val name: String,
val birthdate: Instant,
val birthdayOfWeekUS: Int? = null,
)
users.updateManyWithPipeline {
set {
User::birthdayOfWeekUS set User::birthdate.dayOfWeekUS
}
}Content copied to clipboard