RSIndex

See source code

A reactive computed index that provides efficient lookups of records by property values. Returns a computed value containing an RSIndexMap with diffs for change tracking.

type RSIndex<R extends UnknownRecord> = Computed<RSIndexMap<R>, RSIndexDiff<R>>;

Example

// Create an index on book authors
const authorIndex: RSIndex<Book, "authorId"> = store.query.index(
  "book",
  "authorId",
);

// Get all books by a specific author
const leguinBooks = authorIndex.get().get("author:leguin");
Prev
RecordScope
Next
RSIndexDiff