AQL Syntax

JFrog REST APIs

Products
JFrog Xray
Content Type
REST API
ft:sourceType
Paligo
<domain_query>.find(<criteria>).include(<fields>).sort(<order_and_fields>).offset(<offset_records>).limit(<num_records>).distinct(<true|false>)

The following table describes the elements.

Element

Description

domain_query

The query corresponding to the primary domain. Must be one of items, builds or entries.

criteria

The search criteria in valid JSON format

fields

(Optional) There is a default set of fields for query output. This parameter lets you specify a different set of fields that should be included in the output

order_and_fields

(Optional) The fields on which the output should be sorted, and the sort order. A default set of fields and sort order is defined for each domain.

num_records

(Optional) The maximum number of records that should be extracted. If omitted, all records answering the query criteria will be extracted.

offset

(Optional) The offset from the first record from which to display results (i.e. how many results should be skipped for display)

distinct

(Optional) Disable or enable unique query results. Enabled by default.

From Artifactory 7.37.x, the AQL query supports disabling of unique results. This can be used to speed up the query or to get the results "as is". This replaces the previous search results for text-based AQL queries, which are unique by default (native SQL selects contain 'distinct' terms).

For example:

// Find all unique jars's names in artifactory 
items.find({"name" : {"$match":"*.jar"}}).include("name")

// Find all jars's names in artifactory includes repeated values across different repositories.
items.find({"name" : {"$match":"*.jar"}}).include("name").distinct(false)
// Find all jar items in a repository called "my_local".
// Property "path" already unique inside single repository and unique results can be disabled for performance reason.
items.find(
        {"repo" : "my_local"},
        {"name" : {"$match":"*.jar"}}
)
.include("path")
.distinct(false)

Limitation

Sort, limit , and offset elements only work in the following cases.

  • Your query does not have an include element

  • If you do have an include element, you only specify fields from the primary domain in it.

For example, in the following query, sort, limit and offset will not work because the primary domain is item, but the include element specifies that fields from the artifact, module and build domains should be displayed:

items.find().include("artifact","artifact.module","artifact.module.build")