Skip to main content

Module index

Module index 

Source
Expand description

Index store for NEDB v2.

Two index types:

  1. ID index (indexes/{coll}/id/{doc_id} → object hash) Atomic file-per-document. Reading is a single fs::read_to_string. Writing is atomic (write .tmp → rename). Parallel reads are lock-free.

  2. Sorted index (indexes/{coll}/{field}.sorted → in-memory BTreeMap) Rebuilt from object store on startup. Persisted as a compact binary file for fast cold start. Used for ORDER BY field ASC/DESC LIMIT n.

Structs§

IdIndex
Per-document ID index — atomic file-per-doc, sharded across 256 subdirs.
SortedIndexes
In-memory sorted index per (collection, field). Rebuilt from object store on startup. O(log n) ORDER BY queries.

Enums§

OrderedValue
Ordered JSON value for BTree indexes (null < bool < number < string < array < object).