MongoDB request DSL • opensavvy.ktmongo.dsl.aggregation • UpdatePipeline
UpdatePipeline¶
interface UpdatePipeline<Document : Any> : Pipeline<Document> , HasProject<Document> , HasSet<Document> , HasUnset<Document>
An update pipeline.
Update pipelines allow more complex updates directly through the various update
functions.
Example¶
users.updateManyWithPipeline {
set {
User::score set (of(User::score) + (of(User::scoreMultiplier) * of(User::dailyScore)))
User::dailyScore set 0
}
}
External resources¶
Properties¶
context
¶
abstract val context:
The context used to generate this pipeline.
Functions¶
project
¶
Specifies a list of fields which should be kept in the document.
reinterpret
¶
abstract fun <New : Any> reinterpret(): Pipeline<New>
Changes the type of the returned document, with no type-safety.
set
¶
Adds new fields to documents, or overwrites existing fields.
toString
¶
JSON representation of this pipeline.
unset
¶
Removes fields from documents.
withStage
¶
Creates a new pipeline that expands on the current one by adding stage
.
writeTo
¶
abstract fun writeTo(writer: )
Writes the entire pipeline into writer
.