update

open fun update(entity: Entity)

Update the given entity in the database.

Parameters

entity

the entity to update.


open fun update(entities: Iterable<Entity>)
open fun update(entities: Stream<Entity>)
open fun update(firstEntity: Entity, vararg entities: Entity)

Update all given entities.

Parameters

entities

the entities to update


@GenerateBridge
open fun update(update: String, vararg params: Any?): PanacheUpdate

Update all entities of this type by the given update document, with optional indexed parameters. The returned io.quarkus.mongodb.panache.common.PanacheUpdate object will allow to restrict on which documents the update should be applied.

Return

a new io.quarkus.mongodb.panache.common.PanacheUpdate instance for the given update document

Parameters

update

the update document, if it didn't contain any update operator, we add $set. It can also be expressed as a query string.

params

optional sequence of indexed parameters


@GenerateBridge
open fun update(update: String, params: Map<String, Any?>): PanacheUpdate

Update all entities of this type by the given update document, with named parameters. The returned io.quarkus.mongodb.panache.common.PanacheUpdate object will allow to restrict on which documents the update should be applied.

Return

a new io.quarkus.mongodb.panache.common.PanacheUpdate instance for the given update document

Parameters

update

the update document, if it didn't contain any update operator, we add $set. It can also be expressed as a query string.

params

Map of named parameters


@GenerateBridge
open fun update(update: String, params: Parameters): PanacheUpdate

Update all entities of this type by the given update document, with named parameters. The returned io.quarkus.mongodb.panache.common.PanacheUpdate object will allow to restrict on which document the update should be applied.

Return

a new io.quarkus.mongodb.panache.common.PanacheUpdate instance for the given update document

Parameters

update

the update document, if it didn't contain any update operator, we add $set. It can also be expressed as a query string.

params

Parameters of named parameters


@GenerateBridge
open fun update(update: Bson): PanacheUpdate

Update all entities of this type by the given update BSON document. The returned io.quarkus.mongodb.panache.common.PanacheUpdate object will allow to restrict on which document the update should be applied.

Return

a new io.quarkus.mongodb.panache.common.PanacheUpdate instance for the given update document

Parameters

update

the update document, as a Document.