MongoDB request DSL • opensavvy.ktmongo.dsl.aggregation.operators • TypeValueOperators • toUuid
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()
}
}
External resources¶
See also¶
TypeValueOperators.type
Get the value's type.