3

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?

4

1 回答 1

4

include元素允许您在结果中仅包含特定属性

例如,以下查询结果将仅包含工件名称和“artifactory.licenses”属性:

items.find({"@artifactory.licenses" : {"$eq" : "MIT"}}).include("name", "@artifactory.licenses")

这将返回例如:

{
"results" : [ {
  "name" : "connection_pool-2.2.0.gem",
  "properties" : [ {
    "key" : "artifactory.licenses",
    "value" : "MIT"
  } ]}
}
于 2016-04-21T14:51:50.307 回答