Docs

Collections in the console: documents, fields and rules

Add documents field by field with typed values or as JSON, import many at once from JSON, JSON Lines or CSV, and set who may read, write and delete each collection.

Updated Oct 17, 2026Open in console
Collections browser: collections, documents and a document’s fieldsCollections browser: collections, documents and a document’s fields
Collections › Data
CollectioncartsDocumentcart_1001Fieldstyped valuesSubcollectioncarts/cart_1001/items

Add a document

Add documents panel with one row per field: name, type and value, and Add fieldAdd documents panel with one row per field: name, type and value, and Add field
Add document: one row per field

Open a collection and choose Add document. Leave Document ID empty for an automatic one. Under Fields, each row is a name, a type and a value; + Add field adds another. The JSON tab edits the same document as text, and switching keeps your data.

TypeValue you enterStored as
stringAny text"Ada"
numberA number36
booleantrue or falsetrue
null—null
timestampA date and timeA timestamp (sortable, comparable in queries)
mapA JSON object: { "city": "Pune" }A nested object
arrayA JSON array: ["a", "b"]A list
geopointlat, lngA location
referencecollection/docA link to another document
bytesBase64Binary data

The form tells you which row is wrong before saving: a missing name, two fields with the same name, a value that isn’t a number, or JSON that doesn’t match the type. Names can’t start with __ or contain /.

Import many

Import many takes a JSON array, one object, JSON Lines or CSV with a header row (address.city columns become nested fields), pasted or uploaded. ID field names the field to use as each document’s ID (empty: automatic). Replace documents that already exist overwrites them; otherwise they are kept and reported. Every 500 documents are written together — all of them or none.

Who can read and write

Rules tab: who can read and write the collection, with shortcuts to allow reads, writes or deletesRules tab: who can read and write the collection, with shortcuts to allow reads, writes or deletes
Collections › Rules

The Rules tab shows the rules for the collection in plain words (“Allow · Read · for signed-in users”). Rules live on the Policies page with your table rules: collections have their own group there, and their rules use three actions:

ActionCovers
doc:readGetting a document, queries and live listeners.
doc:writeAdding and updating documents.
doc:deleteRemoving documents.
ALLOW IF ctx.action == "doc:read" AND ctx.resource.name == "orders" AND ctx.actor.is_anonymous == False
ALLOW IF ctx.action == "doc:write" AND ctx.resource.name == "orders" AND "STAFF" IN ctx.actor.roles

With no rule that allows them, app users are refused; your team and the service key always have access. Allow reads / writes / deletes on an empty Rules tab opens Policies with a complete rule filled in. Row security on the document table is an optional extra layer for app users.

Policies page with a Collections group next to tablesPolicies page with a Collections group next to tables
Policies: collections have their own group

From code

await sov.doc('carts/cart_1001').set({
  customer_id: user.id,
  items: [{ sku: 'tea-01', qty: 2 }],
})
const mine = await sov.collection('carts').where('customer_id', '==', user.id).limit(20).get()
Something unclear or missing on this page?Tell us