setToCurrentDate
Sets this field to the current date.
If the field does not exist, this operator adds the field to the document.
Example
class User(
val name: String?,
val age: Int,
val modificationDate: Instant,
)
collection.filter {
User::name eq "Bob"
}.updateMany {
User::age set 18
User::modificationDate.setToCurrentDate()
}
Content copied to clipboard
External resources
Sets this field to the current timestamp.
If the field does not exist, this operator adds the field to the document.
The time Timestamp is internal. Instant should be preferred. For more information, see Timestamp.
Example
class User(
val name: String?,
val age: Int,
val modificationDate: Timestamp,
)
collection.filter {
User::name eq "Bob"
}.updateMany {
User::age set 18
User::modificationDate.setToCurrentDate()
}
Content copied to clipboard