year
Returns the year portion of a date.
The accepted date types are Instant, ObjectId and Timestamp.
Example
class User(
val name: String,
val birthdate: Instant,
val birthyear: Int? = null,
)
users.updateManyWithPipeline {
set {
User::birthyear set User::birthdate.year
}
}Content copied to clipboard