Type parameters
Hierarchy
-
GenericDatabaseReader<DataModel> ↳SelectableDatabaseReader
Properties
system
• system:BaseDatabaseReader<SystemDataModel>
An interface to read from the system tables within Bijection query functions.
System tables include _storage (file metadata) and
_scheduled_functions (scheduled function state). Use ctx.db.system.get()
and ctx.db.system.query() just like regular tables.
Example
Inherited from
GenericDatabaseReader.systemMethods
get
▸ get<TableName, Fields>(table, id, options): Promise<null | SelectedDocument<DocumentByName<DataModel, TableName>, Fields>>
Fetch selected top-level properties, retaining _id and _creationTime.
Property and object access is enforced before disclosure. Null means the
document is absent; refused access is an error, never a redacted document.
Type parameters
Parameters
Returns
Promise<null | SelectedDocument<DocumentByName<DataModel, TableName>, Fields>>
Inherited from
GenericDatabaseReader.get ▸ get<TableName>(table, id): Promise<null | DocumentByName<DataModel, TableName>>
Fetch a single document from the database by table name and
GenericId.
Example
Type parameters
Parameters
Returns
Promise<null | DocumentByName<DataModel, TableName>>
- The GenericDocument of the document at the given GenericId, or
nullif it no longer exists.
Inherited from
GenericDatabaseReader.get ▸ get<TableName>(id): Promise<null | DocumentByName<DataModel, TableName>>
Fetch a single document from the database by its GenericId.
Supported for backwards compatibility. Prefer db.get(tableName, id) in
new code, or db.system.get(tableName, id) for system tables.
Type parameters
Parameters
Returns
Promise<null | DocumentByName<DataModel, TableName>>
- The GenericDocument of the document at the given GenericId, or
nullif it no longer exists.
Inherited from
GenericDatabaseReader.getnormalizeId
▸ normalizeId<TableName>(tableName, id): null | TableKey<DataModel, TableName>
Returns the string ID format for the ID in a given table, or null if the ID
is from a different table or is not a valid ID.
This accepts the string ID format as well as the .toString() representation
of the legacy class-based ID format.
This does not guarantee that the ID exists (i.e. db.get(tableName, id) may return null).
Type parameters
Parameters
Returns
null | TableKey<DataModel, TableName>
Inherited from
GenericDatabaseReader.normalizeIdquery
▸ query<TableName>(tableName): SelectableQueryInitializer<NamedTableInfo<DataModel, TableName>>
Begin a query for the given table name.
Queries don’t execute immediately, so calling this method and extending its
query are free until the results are actually used.
Type parameters
Parameters
Returns
SelectableQueryInitializer<NamedTableInfo<DataModel, TableName>>
- A QueryInitializer object to start building a query.