Skip to Content
ConceptsCollections

Collections

A collection is a named group of documents inside a database — the rough equivalent of a table, but schema-free. You don’t declare a collection; it comes into being the first time you insert into it.

db.Insert("orders", """{ "pnr": "ABC123" }"""); // "orders" now exists
SELECT * FROM orders WHERE pnr = 'ABC123';

Collection names are the table names in SQL and the path segments in the REST API (/query, and per-database /db/{name}/query). Documents in one collection need not share a shape — indexes are declared per path, not per schema.

Reads against a collection that doesn’t exist return an empty result set, not an error.

Last updated on