Expand description
The Firestore data model as hidane implements it.
order: how Firestore orders values (orderBy, cursors, range filters) and document names (__name__).key: an order-preserving byte encoding of the same order, for storage keys and indexes:compare(a, b) == encode(a).cmp(&encode(b))for every pair of values.path: document and collection paths;field_path: field paths and mask operations.store: the storage boundary and the in-memory engine (versioned documents, snapshot reads, commits that report what changed).transform: field transforms (server timestamps, increments, array unions, …).normalize: what Firestore does to a value when it is written (timestamps lose their sub-microsecond digits).export: the official emulator’s export format (LevelDB logs of App Engine entities).
Every rule here was checked against the official emulator v1.22.0; the observations live in
tests/fixtures/value_order.json and are regenerated with tools/oracle/value_order.py.
Modules§
- export
- The official emulator’s export format (Cloud Datastore’s managed export), byte for byte.
- field_
path - Field paths (
a.b,`x.y`.z) and the operations masks need on document fields. - hash_
order - The iteration order of a Java
HashMap<String, _>. - key
- Order-preserving byte encoding of values and document names.
- normalize
- What Firestore does to values when it stores them.
- order
- Firestore value ordering.
- path
- Document and collection paths, relative to
projects/{p}/databases/{d}/documents. - store
- The storage boundary (ADR 0002).
- transform
- Field transforms (
serverTimestamp,increment,maximum,minimum,arrayUnion,arrayRemove).