Database metadata

Reading or writing database documents requires an admin key.

Problem

You want to store additional metadata within a database document.

Solution

Set the data field in a database:

Copied!
(('llyr'), { data: { env: 'test' } })
{
  ref: ("llyr"),
  ts: 1624310577730000,
  name: 'llyr',
  data: { env: 'test' },
  global_id: 'yoat8nnggybyy'
}
Query metrics:
  •    bytesIn:   85

  •   bytesOut:  170

  • computeOps:    1

  •    readOps:    0

  •   writeOps:    1

  •  readBytes:  243

  • writeBytes:  243

  •  queryTime: 17ms

  •    retries:    0

Discussion

It is not possible to revise the parent database, the current database, or any of the current database’s peers using Update. You can only add metadata to the documents that describe child databases.

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!