switch_alias

Atomically repoint an alias to a different collection — the zero-downtime swap used to roll out a rebuilt collection.

Example

up:
  - op: switch_alias
    alias: products
    to_collection: products_v2

# Spell out the inverse — revector does not record the previous target.
down:
  - op: switch_alias
    alias: products
    to_collection: products_v1

Fields

FieldTypeRequiredDescription
aliasstringyesAlias to repoint.
to_collectionstringyesNew target collection.

Reversibility

Not auto-reversible — the previous target isn't stored. Supply an explicit down: that switches the alias back to the prior collection.