跳到主要内容

FindByCursorOptions<T, U, W>

Defined in: packages/rxdb/src/repository/query-options.interface.ts:70

FindByCursor 查询选项

Type Parameters

Type ParameterDefault type
T extends EntityTypeEntityType
URuleGroup<InstanceType<T>>
W extends stringstring

Properties

after?

optional after: InstanceType<T>;

Defined in: packages/rxdb/src/repository/query-options.interface.ts:98

获取这个实体之后的实体


before?

optional before: InstanceType<T>;

Defined in: packages/rxdb/src/repository/query-options.interface.ts:93

获取这个实体之前的实体


limit?

optional limit: number;

Defined in: packages/rxdb/src/repository/query-options.interface.ts:107

获取数据量 注意:limit 首次返回会 <=100, 但是第二次,增量场景下并不一定保持 100 他会根据实际情况变化 例如:页面滚动触发有两个 FindByCursor 查询组成了一组数据,这时候有个数据被创建且数据满足第一个查询条件 那么更新后的数据量就会比 limit 多 1, 第二个 FindByCursor 开头的指针是不会变的,所以没有影响第二个结果集

Default

100

orderBy

orderBy: OrderBy<W>[];

Defined in: packages/rxdb/src/repository/query-options.interface.ts:88

排序条件 指针查询的时候必须包含唯一值的排序例如: id 作为最后一个排序参数,不然无法定位指针

Example

orderBy: [
{ field: 'createdAt', sort: 'DESC' },
{ field: 'id', sort: 'ASC' } // 必须包含唯一值排序
]

where

where: U;

Defined in: packages/rxdb/src/repository/query-options.interface.ts:75