Rename a collection

Problem

You need to rename a collection within the current database.

Solution

Use the Update function:

Copied!
(
  ('huts'),
  { name: 'dilapidated_huts' },
)
{
  ref: ("dilapidated_huts"),
  ts: 1624310573640000,
  history_days: 30,
  name: 'dilapidated_huts'
}
Query metrics:
  •    bytesIn:   80

  •   bytesOut:  164

  • computeOps:    1

  •    readOps:    0

  •   writeOps:    1

  •  readBytes:  126

  • writeBytes:  362

  •  queryTime: 20ms

  •    retries:    0

More information

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!