toUuid
Converts a string value to a Uuid (BsonType.BinaryData).
Example
class User(
val _id: ObjectId,
val eventId: Uuid,
)
// Convert old 'eventId' data which was incorrectly created as strings
users.updateManyWithPipeline {
set {
User::eventId set of(User::eventId).toUuid()
}
}
Content copied to clipboard
External resources
See also
Get the value's type.