Artifactory AQL获得特定属性 [英] Artifactory AQL Get Specific Properties
问题描述
我正在使用Artifactory 3.5.我的工件具有自定义属性.我希望能够查询具有该属性的所有工件,并且希望结果显示该属性及其值.我知道我可以使用:
I'm using Artifactory 3.5. My artifacts have custom properties. I want to be able to query for all artifacts that have that property and I want the result to show the property and its value. I know I can use:
items.find(...).include("property.*")
但是,这将返回与查找条件匹配的项目的所有属性.如何仅显示所需的特定属性?
However, this returns all properties for the item matching the find criteria. How can I display only the specific property that I want?
推荐答案
include 元素允许您在结果中仅包含特定属性
The include element allows you to include only specific properties in the results
例如,以下查询结果将仅包含工件名称和"artifactory.licenses"属性:
For example, the following query results will only include the artifact name and the "artifactory.licenses" property:
items.find({"@artifactory.licenses" : {"$eq" : "MIT"}}).include("name", "@artifactory.licenses")
这将返回例如:
{
"results" : [ {
"name" : "connection_pool-2.2.0.gem",
"properties" : [ {
"key" : "artifactory.licenses",
"value" : "MIT"
} ]}
}
这篇关于Artifactory AQL获得特定属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!