Search code examples
artifactoryartifactory-query-lang

How can I limit an Artifactory aql query to a specific repository?


I have this working aql query:

items.find({"@myproperties.fileType":{"$match": "myFile"},"@myproperties.otherType":{"$match": "thisType"}})

It returns all the results I expect. However, this query looks for files containing these properties in every repository.
How can I limit the search to a specific repository?


Solution

  • This is the format needed:

    items.find({"repo":{"$eq":"myrepo"}}, {"$and":[{"@myproperties.fileType":{"$match": "myFile"}},{"@myproperties.otherType":{"$match": "thisType"}}]})   
    

    This query language isn't very intuitive, but there it is.