QueryExpression

See source code

Query expression for filtering records by their property values. Maps record property names to matching criteria.

type QueryExpression<R extends object> = {
  [k in keyof R & string]?: QueryValueMatcher<R[k]>
}

Example

// Query for books published after 2020 that are in stock
const bookQuery: QueryExpression<Book> = {
  publishedYear: { gt: 2020 },
  inStock: { eq: true },
}

// Query for books not by a specific author
const notByAuthor: QueryExpression<Book> = {
  authorId: { neq: 'author:tolkien' },
}
Prev
MigrationResult
Next
QueryValueMatcher