MongoDB request DSL • opensavvy.ktmongo.dsl.query • UpdateWithPipelineQuery • unset
unset¶
open fun unset(block: UnsetStageOperators<Document>.() -> Unit)
Deletes existing fields.
This method is equivalent to the `$unset
stage`.
Example¶
class User(
val name: String,
val age: Int,
val oldValue: String,
)
users.updateManyWithPipeline {
unset {
exclude(User::age)
}
}