The model to query
The model to query
Model: Model.filter and Model.orderBy for how queries are usually created
Executes the query and returns all the results.
Optionaltx: IDBTransactionUpdate the filters of the query. This will not reset the filters, but will merge the new filters with the old ones.
For ranges, it is recommended to use a BetweenFilter for performance reasons.
Executes the query and returns the first result.
Optionaltx: IDBTransactionLoops over the results of the query. This is useful if you want to do something with each result, but don't want to wait for all the results to be fetched. This is also useful if you want to modify the database while iterating over the results. Any operation should use the same transaction as the one passed to the callback.
If the callback returns true, the loop will stop.
The callback to call for each result
The transaction or mode to use, make sure to use 'readwrite' if you want to modify the database
Executes the query and updates all the results.
The updates to apply to the results
Optionaltx: IDBTransactionDefine the index to use for the query, with an optional filter query. Given that the orderBy also uses the index, only one can be used at once, up to you to benchmark which one is faster.
The index to use
Optionalquery: BetweenFilter<unknown>
The query to use on the index
A query builder for the models.
A query is lazy, meaning that it will not execute until you call one of the methods.
A query is linked to a model, meaning that you can only query the model that you created the query from.