Schema
The type represents your database structure and provides type shortcuts for all kinds of data. It’s helpful to use it side by side with the database instance so that you can type your functions.
It’s inferred from your database type with the help of Typesaurus.Schema
.
The types are accessible through their name in the schema.
Subcollections
To access subcollections, you can use "sub"
property:
Id
The type represents the document id.
Collection
The type represents the collection Collection
instance.
Ref
The type represents the document Ref
instance.
Doc
The type represents the document Doc
instance.
Data
The type represents the document data. It’s what you get reading or creating a document via collection’s doc
.
Result
The type represents the result of a reading operation, like the get
method. It can be the Doc
instance, null
if the document is not found, or undefined
if the operation is still in progress.
AssignArg
The type represents the argument of an assign function. It can be used for all writing operations and expects the complete document data.
It unions AssignData
and AssignGetter
types.
AssignData
The type represents the data of an assign function. It can be used for all writing operations and expects the complete document data.
AssignGetter
The type represents the getter of an assign function. It can be used for all writing operations and expects the complete document data.
WriteHelpers
The type represents the write helpers of an assign function. It can be used for all writing operations.
UpdateBuilder
The type represents the update builder object.
UpdateArg
The type represents the argument of an update function.
It unions UpdateData
and UpdateGetter
types.
UpdateData
The type represents the data of an update function.
UpdateGetter
The type represents the getter of an update function.
UpdateHelpers
The type represents the update helpers of an update function.
QueryBuilder
The type represents the query builder object.
QueryData
The type represents what the query
method expects you to return from the query function.
QueryGetter
The type represents the query function.
QueryHelpers
The type represents the query helpers of a query function.
ServerDoc
The type is a server version of the Doc
type where server dates are always present, unlike the client version where they might be null
.
→ Read more about server dates
ServerData
The type is a server version of the Data
type where server dates are always present, unlike the client version where they might be null
.
→ Read more about server dates
ServerResult
The type is a server version of the Result
type where server dates are always present, unlike the client version where they might be null
.
→ Read more about server dates
ServerAssignArg
The type is a server version of the AssignArg
type where server dates are always present, unlike the client version where they might be null
.
→ Read more about server dates
ServerAssignData
The type is a server version of the AssignData
type where server dates are always present, unlike the client version where they might be null
.
→ Read more about server dates
ServerAssignGetter
The type is a server version of the AssignGetter
type where server dates are always present, unlike the client version where they might be null
.
→ Read more about server dates
ServerUpdateBuilder
The type is a server version of the UpdateBuilder
type where server dates are always present, unlike the client version where they might be null
.
→ Read more about server dates
ServerUpdateArg
The type is a server version of the UpdateArg
type where server dates are always present, unlike the client version where they might be null
.
→ Read more about server dates
ServerUpdateData
The type is a server version of the UpdateData
type where server dates are always present, unlike the client version where they might be null
.
→ Read more about server dates
ServerUpdateGetter
The type is a server version of the UpdateGetter
type where server dates are always present, unlike the client version where they might be null
.
→ Read more about server dates
ServerUpdateHelpers
The type is a server version of the UpdateHelpers
type where server dates are always present, unlike the client version where they might be null
.
→ Read more about server dates
TransactionReadDoc
The type represents transaction read document. What you return from the transaction read function.
→ Read more about transactions
TransactionWriteDoc
The type represents transaction write document. What you get in the transaction write function.
→ Read more about transactions
Def
The type represents the document definition. It’s in many methods as a generic parameter.