5.0.18 • Published 5 months ago

@travetto/model-query-language v5.0.18

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Data Model Query Language

Datastore query language.

Install: @travetto/model-query-language

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 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

not (age < 35) and contact != null

A more complex query would look like:

Code: Query language with more complex needs

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.

5.0.17

5 months ago

5.0.18

5 months ago

5.0.16

6 months ago

5.0.15

7 months ago

5.0.14

8 months ago

5.0.13

8 months ago

5.0.6

9 months ago

5.0.10

9 months ago

5.0.11

9 months ago

5.0.12

9 months ago

5.0.9

9 months ago

5.0.8

9 months ago

5.0.7

9 months ago

5.0.5

9 months ago

5.0.4

9 months ago

5.0.3

10 months ago

5.0.2

10 months ago

5.0.1

10 months ago

5.0.0

10 months ago

5.0.0-rc.12

10 months ago

5.0.0-rc.13

10 months ago

5.0.0-rc.14

10 months ago

5.0.0-rc.15

10 months ago

5.0.0-rc.11

10 months ago

5.0.0-rc.10

11 months ago

5.0.0-rc.9

11 months ago