artifactoryjfrog-cliartifactory-query-langjfrog-container-registry

How can we define path more than one in Jfrog aql language spec file?


Here below the defined spec file, I want to add more values in the "path": {$match}function. I mean I need to define more than one path in this syntax is that possible? i.e.: Test/dev , Test/qa , Test/prod etc..

  "files": [
    {
      "aql": {
        "items.find": {
          "repo": "Testing",
          "path": {"$match":"Test/dev"},
          "name": {"$match":"*"},
          "type": "file",
          "$or": [
            {
              "$and": [
                {
                  "created": { "$before":"90d" }
                }
              ]
            }
          ]
        }
      }
    }
  ]
}

Solution

  • You can add them in the "or" clause:

    {
      "files": [
        {
          "aql": {
            "items.find": {
              "repo": "Testing",
              "name": { "$match": "*" },
              "type": "file",
              "created": { "$before": "90d" },
              "$or": [{ "$match": "Test/dev" }, { "$match": "Test/qa" }]
            }
          }
        }
      ]
    }
    

    Read more:

    1. AQL documentation
    2. Using File Specs