Using AQL With Virtual Repositories


JFrog Xray
Content Type

AQL supports virtual repositories. Since virtual repositories only contain items indirectly through the local repositories they include, several conventions have been laid down as described in the following sections.

Filtering on a Virtual Repository

You may limit queries to search in a specified virtual repository. In practice this means that the query will be applied to local repositories and remote repository caches included in the specified virtual repository.

For example, find all the items within any repository contained in a virtual repository called my-virtual.

items.find({"repo" : "my-virtual"})

Output Fields

The item domain has a virtual_repos field which includes the virtual repositories in which a found item is contained. In general, to display this field, you need to expressly specify it in your query as an output field. However, if your query specifies a virtual repository as its search target, the virtual_repos field is implicitly included in the search results as an output field.

An item must be accessible in order to be found

A search query will only find an item in a virtual repository if it is accessible by that virtual repository. For example, the local repository that contains an item may specify and include or exclude pattern which prevents access to the item by the encapsulating virtual repository. In this case the search query will not find the item.