如何在文件规范中更改AQL查询的包含部分

时间:2019-03-08 12:10:17

标签: artifactory artifactory-query-lang

我想更改格式为Artifactory的文件规范的AQL字符串的输出。

查询如下:

{
    "files": [
        {
            "aql": {
                "items.find":{
                    "repo":"gradle-dev-local",
                    "$or":[
                        {
                            "$and": [
                                { "stat.downloads": { "$eq":null } },
                                { "updated": { "$before": "7d" } }
                            ]
                        },
                        {
                            "$and": [
                                { "stat.downloads": { "$gt": 0 } },
                                { "stat.downloaded": { "$before": "30d" } }
                            ]
                        }
                    ]
                }
            }
        }
    ]
}

在纯AQL REST API调用中,我将包括以下内容:

"include":["repo", "name", "path", "updated", "sha256", "stat.downloads", "stat.downloaded"]

但是使用时,它不会传递到查询的右侧,导致出现以下错误消息:

  

无法解析查询:items.find({
                      “ repo”:“ mfm-gradle-dev-local”,
                      “ $ or”:[
                          {
                              “ $ and”:[
                                  {“ stat.downloads”:{“ $ eq”:null}},
                                  {“更新”:{“ $ before”:“ 7d”}}
                              ]
                          },
                          {
                              “ $ and”:[
                                  {“ stat.downloads”:{“ $ gt”:0}},
                                  {“ stat.downloaded”:{“ $ before”:“ 30d”}}
                              ]
                          }
                      ]
                  },
                  “ include”:[“ repo”,“ name”,“ path”,“ updated”,“ sha256”,“ stat.downloads”,“ stat.downloaded”]
              ).include(“ name”,“ repo”,“ path”,“ actual_md5”,“ actual_sha1”,“ size”,“ type”,“ property”),在以下子查询附近似乎存在语法错误:
  “ include”:[“ repo”,“ name”,“ path”,“ updated”,“ sha256”,“ stat.downloads”,“ stat.downloaded”]

如何格式化AQL,以便同时传递include语句?

1 个答案:

答案 0 :(得分:0)

如果您使用的是JFrog CLI,则存在一个尚待解决的问题(github.com/jfrog/jfrog-cli-go/issues/320),它能够在搜索查询中添加包含项(同时使用-s参数和文件规范)。如果到目前为止我们什么都错过了,请随时为该问题添加其他信息。