drift Docs
Start
What is Drift?
The tour, if you are new here.
Why Drift?
The case for a smaller cloud.
Getting started
Nothing to deployed, in one command.
Architecture
How a slice is put together.
What it costs
The free grant, five unit prices, two rules.
Build
Canvas
Static sites, same origin as your API.
Tools
Operate
Auth
Accounts, tokens and scopes.
Security
Boundaries, sandboxing and hardening.

NoSQL

drift.Backbone.NoSQL.Collection(name): JSON document collections.

Signatures

Go
Insert(doc any)                       (string, error)   // returns a STORAGE KEY, not your _id
Get(id string)                       (json.RawMessage, error)   // looks up the doc's _id FIELD
Read(key string)                      (json.RawMessage, error)   // looks up the STORAGE KEY Insert returned
List(filter map[string]string)         ([]json.RawMessage, error) // one doc per element, unmarshal each
Delete(key string)                    error                     // by STORAGE KEY
Drop()                               error

Spelled drift.backbone.nosql.collection(c) in the interpreted SDKs. In Node every call is async, so await it.

Two keys, and they are not interchangeable

Insert returns an internal storage key, not the _id. Read and Delete take that storage key; Get takes your own _id field. Keep whichever one you'll look up by: set an _id on the document and use Get, or hold the key Insert handed back and use Read.

On a deployed slice Insert returns an empty string.

The write endpoint answers with text, not a key. Locally it returns a key. So a function that holds the return value and calls Read with it works on your laptop and fails on a slice: set an _id and use Get instead.

Filtering

List is equality-only: the filter matches fields exactly, with no ordering, ranges, or pagination. When you need WHERE seq > 100 ORDER BY seq (op-logs, feeds, cursors) reach for SQL.

Only one field/value pair is honoured, and only top-level scalars are indexed. The Backbone guide has the charset rules and what happens to a value that falls outside them.