Literals
Update
Atomic value replacement for literal type fields
Literal values are atomic — they are always fully replaced, never partially merged. When you update a literal field, you provide the complete new value:
// Switch from string to object — provide the full object
await client.db.Model.updateMany({
where: { id: record.id },
data: { shape: { x: 1.0, y: 2.0 } },
});
// Switch from object back to string
await client.db.Model.updateMany({
where: { id: record.id },
data: { shape: 'none' },
});There is no partial update for literal fields — if you pass an object variant, all required fields must be present.
For literal type definitions and variant kinds, see Literals.