stable

Collection

A collection: the typed record set inside a vault. What a collection is, how you open one, and the section map for its reference, querying, and schema.

A Collection<T> is a typed set of records inside a vault. You open one with const invoices = vault.collection<Invoice>('invoices'), and the TypeScript generic T carries through get / put / query / scan, so records come back typed. It is the bottom of the Noydb → Vault → Collection<T> hierarchy — the handle you actually read and write records through.

Records are encrypted inside the hub before they reach any storage backend, so the store only ever holds ciphertext and can never run a query. Everything a collection does — reading, writing, querying, validating — happens client-side, after decryption.

In this section

  • Collection — the object reference for the Collection<T> instance: reading and writing, bulk operations, querying and scanning, change events, deterministic lookup, and introspection.
  • Querying — the always-on read path: the chainable query() builder (where / orderBy / limit), the streaming scan() builder, subscriptions, and the operator set.
  • Schema — the always-on typing scaffold: attach any Standard Schema v1 validator; input is validated before encryption, output after decryption.

Capabilities that add methods once their service is opted in — history, search, blobs, presence, tiers, classified fields, and more — are listed under Unlocked by services on the methods page.