跳到主要内容

FindAllOptions<T, U, W>

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

FindAll 查询选项

Type Parameters​

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

Properties​

orderBy?​

optional orderBy?: OrderBy<W>[];

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

排序条件

Example​

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

***

### where \{#where\}

```ts
where: U;

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

查询条件 用于过滤查询结果 支持组合查询

Example​

where: {
combinator: 'and',
rules: [
{ field: 'status', operator: '=', value: 'active' },
`{ field: 'createdAt', operator: '>=', value: '2023-01-01' }`
]
}