Skip to content

VaultMD / WhereCondition

Type Alias: WhereCondition

WhereCondition = object

Defined in: src/query/models/where-map.ts:19

The operator form of a WhereMap entry. Every operator present is applied, AND-ed together, so { gte: 1, lt: 10 } is a half-open range.

Example

ts
// due before August, and not already done
vault.query.queryNotes({
  where: { due: { lt: '2026-08-01' }, status: { ne: 'done' } },
});

Properties

exists?

optional exists?: boolean

Defined in: src/query/models/where-map.ts:44

Whether the field is present at all. false selects notes that lack the field; a field explicitly set to null counts as absent.


gt?

optional gt?: WhereValue

Defined in: src/query/models/where-map.ts:35

Greater than.


gte?

optional gte?: WhereValue

Defined in: src/query/models/where-map.ts:37

Greater than or equal.


in?

optional in?: WhereValue[]

Defined in: src/query/models/where-map.ts:39

Set membership. An empty list matches nothing.


lt?

optional lt?: WhereValue

Defined in: src/query/models/where-map.ts:31

Less than.


lte?

optional lte?: WhereValue

Defined in: src/query/models/where-map.ts:33

Less than or equal.


ne?

optional ne?: WhereValue

Defined in: src/query/models/where-map.ts:29

Not equal. A note missing the field matches, since "unset" is not the value — pair with exists: true to require the field as well.

Match the operand's type to the stored one. SQLite holds values of different types to be never equal, so { ne: '5' } against a numeric field excludes nothing and quietly returns every note — where the same mismatch on equality or a range would return an obvious empty result.