Skip to main content
Collections are the script’s database. You declare the collections and who can read and write in supabase/collections.json.

collections.json

Limits: up to 20 collections; names with lowercase letters, numbers, _ and -, up to 40 characters. The file is read when the backend is deployed. If it contains an error, the previous collections remain and the error appears in the deployment summary.

Use inside a function

Document format

mine indicates whether the caller created the document. The document never shows who created it.

Important rules

  • The document must be an object and no larger than 64 KB.
  • Up to 10,000 documents per collection.
  • update and delete only work for the document’s creator or the script owner, even if the write rule is users or public.
Possible errors: “Collection … does not exist in supabase/collections.json.”, “No permission to read/write in …”, “Document not found.”, “Document too large (max. 64 KB).”, “Limit of 10000 documents per collection.”, “Only the document’s creator (or the script owner) can modify it.”

Through the API

The same collections and rules apply in the API: see Collections and documents.