0

我想更改格式化为 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"]

但是在使用时,它并没有传入查询的正确部分,从而导致以下错误消息:

Failed to parse query: items.find({  
                    "repo":"mfm-gradle-dev-local",  
                    "$or":[  
                        {  
                            "$and": [  
                                { "stat.downloads": { "$eq":null } },  
                                { "updated": { "$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"), it looks like there is syntax error near the following sub-query:    "include":["repo", "name", "path", "updated", "sha256", "stat.downloads", "stat.downloaded"]

如何格式化 AQL 以使包含语句也通过?

4

1 回答 1

0

如果您使用的是 JFrog CLI,则存在一个未解决的问题 ( github.com/jfrog/jfrog-cli-go/issues/320 ) 可以在搜索查询中添加包含项(均使用 -s 参数和文件眼镜)。如果到目前为止我们遗漏了任何内容,请随时向该问题添加其他信息。

于 2019-03-14T14:51:37.737 回答