weekUS
Returns the week of the year for a date, ranging from 0 to 53.
Weeks begin on Sundays, and week 1 begins with the first Sunday of the year. Days preceding the first Sunday of the year are in week 0.
The accepted date types are Instant, ObjectId and Timestamp.
Example
class User(
val name: String,
val birthdate: Instant,
val birthweekUS: Int? = null,
)
users.updateManyWithPipeline {
set {
User::birthweekUS set User::birthdate.weekUS
}
}Content copied to clipboard