Skip to content

Bulk Updates

Use updateWhere when you need to modify multiple records that share common characteristics. This is more efficient and maintainable than writing individual update entries for each record.

ApproachUse When
updateWhereModifying many records based on shared properties
updateTargeting a specific record by ID or applying unique overrides

Filters match records based on field values:

Filter TypeSyntaxExampleMatches
Exact matchfield: valuecategory: axeRecords where category equals “axe”
Rangefield: min..maxrequiredLevel: 60..70Records with requiredLevel between 60 and 70 (inclusive)
Any-offield: [a, b, c]rarity: [0, 1, 2]Records where rarity is 0, 1, or 2
Flags includesfield: [flagA, flagB]flags: [tradeable, stackable]Records whose flags include all specified values

Multiple conditions in a single filter use AND logic—all conditions must match:

filter:
category: axe
requiredLevel: 60..70
rarity: [1, 2]

This matches records that are axes AND have level 60-70 AND have rarity 1 or 2.

When multiple updateWhere rules match the same record, later rules override earlier rules for overlapping fields:

updateWhere:
# Rule 1: All axes get base price
- filter:
category: axe
changes:
sellPrice: 100
# Rule 2: High-level items get premium price (overrides Rule 1)
- filter:
requiredLevel: 60..70
changes:
sellPrice: 500

A level 65 axe matches both rules. Since Rule 2 comes later, it gets sellPrice: 500.

Operations execute in this sequence:

  1. create — Add new records
  2. updateWhere — Apply bulk modifications by filter
  3. update — Apply individual record modifications
  4. delete — Remove records

This order means update serves as an escape hatch for specific overrides after bulk changes:

items:
updateWhere:
- filter:
category: axe
changes:
sellPrice: 100
update:
# Override the bulk change for this specific item
- id: 99001
changes:
sellPrice: 999

Update all axes in a level range with tiered pricing:

spec:
version: "1.0"
items:
updateWhere:
# All axes get base price
- filter:
category: axe
changes:
sellPrice: 100
# High-level items get premium price (overrides above)
- filter:
requiredLevel: 60..70
changes:
sellPrice: 500
update:
# Specific override for special item
- id: 99001
changes:
sellPrice: 999