Skip to content

Latest commit

 

History

History
25 lines (21 loc) · 635 Bytes

mass-statement.md

File metadata and controls

25 lines (21 loc) · 635 Bytes

MASS STATEMENT

Activate supports mass update/delete statements. Use then when you have to perform a really big update/delete operation. It’s recommended to be used only on migrations.

MASS UPDATE

Example:

update {
    (entity: MyEntity) => where(entity.attribute :== "string1") set (entity.attribute := "string2")
}

Multiple attributes update:

update {
    (entity: MyEntity) => where(entity.attribute :== "string1") set (entity.attribute := "string2", entity.otherAttribute := 100)
}

MASS DELETE

delete {
    (entity: MyEntity) => where(entity.attribute :== "string1")
}