# @travetto/model-query-language

> Datastore query language.

Latest version **8.0.8** (published 2026-09-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @travetto/model-query-language
pnpm add @travetto/model-query-language
yarn add @travetto/model-query-language
bun add @travetto/model-query-language
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 8.0.8 |
| Published | 2026-09-15 |
| First published | 2024-08-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 17 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 23 |
| Author | Travetto Framework |
| Maintainers | arcsine |
| Keywords | datastore, query-language, schema, travetto, typescript |

## Links

- npm: https://www.npmjs.com/package/@travetto/model-query-language
- Repository: https://github.com/travetto/travetto
- Homepage: https://travetto.io
- Issues: https://github.com/travetto/travetto/issues
- npm.io page: https://npm.io/package/@travetto/model-query-language

## Dependencies (3)

- [@travetto/model](https://npm.io/package/@travetto/model.md) ^8.0.4
- [@travetto/schema](https://npm.io/package/@travetto/schema.md) ^8.0.2
- [@travetto/model-query](https://npm.io/package/@travetto/model-query.md) ^8.0.8

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 8.0.8 (latest) — 2026-09-15
- 8.1.0-rc.4 (rc) — 2026-11-01
- 8.0.0-alpha.31 (alpha) — 2026-08-24
- 8.1.0-rc.3 — 2026-11-01
- 8.1.0-rc.2 — 2026-11-01
- 8.1.0-rc.1 — 2026-10-31
- 8.1.0-rc.0 — 2026-10-31
- 8.0.7 — 2026-09-15
- 8.0.6 — 2026-09-13
- 8.0.5 — 2026-09-12
- 8.0.4 — 2026-09-12
- 8.0.3 — 2026-09-12
- 8.0.2 — 2026-09-11
- 8.0.1 — 2026-09-05
- 8.0.0 — 2026-09-05
- … 80 more at https://npm.io/package/@travetto/model-query-language/versions

## README

<!-- This file was generated by @travetto/doc and should not be modified directly -->
<!-- Please modify https://github.com/travetto/travetto/tree/main/module/model-query-language/DOC.tsx and execute "npx trv doc" to rebuild -->
# Data Model Query Language

## Datastore query language.

**Install: @travetto/model-query-language**
```bash
npm install @travetto/model-query-language

# or

yarn add @travetto/model-query-language
```

This module provides a textual query language for the [Data Model Querying](https://github.com/travetto/travetto/tree/main/module/model-query#readme "Datastore abstraction for advanced query support.") interface. The language itself is fairly simple, boolean logic, with parenthetical support.The operators supported are:

## Query Language

   *  `<`, `<=` - Less than, and less than or equal to
   *  `>`, `>=` - Greater than, and greater than or equal to
   *  `!=`, `==` - Not equal to, and equal to
   *  `~` - Matches regular expression, supports the `i` flag to trigger case insensitive searches
   *  `!`, `not` - Negates a clause
   *  `in`, `not-in` - Supports checking if a field is in a list of literal values
   *  `and`, `&&` - Intersection of clauses
   *  `or`, `||` - Union of clauses

All sub fields are dot separated for access, e.g. `user.address.city`.A query language version of the previous query could look like:

**Code: Query language with boolean checks and exists check**
```sql
not (age < 35) and contact != null
```

A more complex query would look like:

**Code: Query language with more complex needs**
```sql
user.role in ['admin', 'root'] && (user.address.state == 'VA' || user.address.city == 'Springfield')
```

### Regular Expression
When querying with regular expressions, patterns can be specified as `'strings'` or as `/patterns/`. The latter allows for the case insensitive modifier: `/pattern/i`. Supporting the insensitive flag is up to the underlying model implementation.

---
_Source: https://npm.io/package/@travetto/model-query-language · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
