Bulk Updates
Overview
Section titled “Overview”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.
| Approach | Use When |
|---|---|
updateWhere | Modifying many records based on shared properties |
update | Targeting a specific record by ID or applying unique overrides |
Filter Syntax
Section titled “Filter Syntax”Filters match records based on field values:
| Filter Type | Syntax | Example | Matches |
|---|---|---|---|
| Exact match | field: value | category: axe | Records where category equals “axe” |
| Range | field: min..max | requiredLevel: 60..70 | Records with requiredLevel between 60 and 70 (inclusive) |
| Any-of | field: [a, b, c] | rarity: [0, 1, 2] | Records where rarity is 0, 1, or 2 |
| Flags includes | field: [flagA, flagB] | flags: [tradeable, stackable] | Records whose flags include all specified values |
Combining Filters
Section titled “Combining Filters”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.
Rule Ordering
Section titled “Rule Ordering”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: 500A level 65 axe matches both rules. Since Rule 2 comes later, it gets sellPrice: 500.
Operation Order
Section titled “Operation Order”Operations execute in this sequence:
- create — Add new records
- updateWhere — Apply bulk modifications by filter
- update — Apply individual record modifications
- 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: 999Example
Section titled “Example”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: 999See Also
Section titled “See Also”- Syntax Reference — Full filter documentation and advanced patterns