weekISO
Returns the week number in ISO 8601 format, ranging from 1 to 53.
Week numbers start at 1 with the week (Monday through Sunday) that contains the year's first Thursday.
The accepted date types are Instant, ObjectId and Timestamp.
Example
class User(
val name: String,
val birthdate: Instant,
val birthweekISO: Int? = null,
)
users.updateManyWithPipeline {
set {
User::birthweekISO set User::birthdate.weekISO
}
}Content copied to clipboard