yearOfISOWeek

@get:JvmName(name = "yearOfISOWeekOfObjectId")
val <R : Any> Value<R, ObjectId>.yearOfISOWeek: Value<R, Int>(source)
@get:JvmName(name = "yearOfISOWeekOfObjectId")
val <R : Any> Field<R, ObjectId>.yearOfISOWeek: Value<R, Int>(source)
@get:JvmName(name = "yearOfISOWeekOfObjectId")
val <R : Any> KProperty1<R, ObjectId>.yearOfISOWeek: Value<R, Int>(source)
@get:JvmName(name = "yearOfISOWeekOfObjectId")
val ObjectId.yearOfISOWeek: Value<Any, Int>(source)
@get:JvmName(name = "yearOfISOWeekOfTimestamp")
val <R : Any> Value<R, Timestamp>.yearOfISOWeek: Value<R, Int>(source)
@get:JvmName(name = "yearOfISOWeekOfTimestamp")
val <R : Any> Field<R, Timestamp>.yearOfISOWeek: Value<R, Int>(source)
@get:JvmName(name = "yearOfISOWeekOfTimestamp")
val <R : Any> KProperty1<R, Timestamp>.yearOfISOWeek: Value<R, Int>(source)
@get:JvmName(name = "yearOfISOWeekOfTimestamp")
val Timestamp.yearOfISOWeek: Value<Any, Int>(source)

Returns the year in ISO 8601 format, corresponding to the ISO week number returned by weekISO.

The year always starts on the first day of weekISO 1, which must be a Monday. This means that the year may start anywhere between January 1st and January 7th (if January 1st was a Tuesday). The year ends on the last synday of the last week, which may be at the start of January for the same reason.

The accepted date types are Instant, ObjectId and Timestamp.

Example

class User(
val name: String,
val birthdate: Instant,
val birthyearOfISOWeek: Int? = null,
)

users.updateManyWithPipeline {
set {
User::birthyearOfISOWeek set User::birthdate.yearOfISOWeek
}
}

External resources