moon supports an integrated query language, known as MQL, that can be used to filter and select
projects from the project graph, using an SQL-like syntax. MQL is primarily used by
moon run with the
A comparison (also known as an assignment) is an expression that defines a piece of criteria, and is a building block of a query. This criteria maps a field to a value, with an explicit comparison operator.
Equals, Not equals
The equals (
=) and not equals (
!=) comparison operators can be used for exact value matching.
You can also define a list of values using square bracket syntax, that will match against one of the values.
Like, Not like
The like (
~) and not like (
!~) comparison operators can be used for wildcard value matching,
using glob syntax.
projectSource~packages/* && tag!~*-app
Like comparisons can only be used on non-enum fields.
|| logical operators can be used to combine multiple comparisons into a condition.
&& operator is used to combine comparisons into a logical AND, and the
|| operator is used
for logical OR.
taskPlatform=system || taskPlatform=node
For readability concerns, you can also use
taskPlatform=system OR taskPlatform=node
Mixing both operators in the same condition is not supported.
For advanced queries and complex conditions, you can group comparisons using parentheses to create logical groupings. Groups can also be nested within other groups.
The following fields can be used as criteria, and are related to task tokens.
Programming language the project is written in, as defined in
Name OR alias of the project.
Alias of the project. For example, the
Name of the project, as defined in
Relative file path from the workspace root to the project root, as defined in
The type of project, as defined in
A tag within the project, as defined in
ID/name of a task within the project.
The platform a task will run against, as defined in
The type of task, based on its configured settings.