Closed chris-alation closed 5 years ago
@chris-alation how did you solve this?
@chris-alation Can you update how you managed to solve this?
Since OP doesn't answer, here is the solution:
aql = ArtifactoryPath("https://myartifactory.com/artifactory", auth=('username','password'))
args = ["items.find", {"$and": [
{ "repo": {"$eq": "myrepo"} },
{
"$or": [
{"path": {"$match": "path/in/repo"}}
]
}
]
},
".sort", {"$desc" : ["created"]},
".limit", [1]
]
artifacts_list = aql.aql(*args)
How would one sort and limit results when using the library? Basically, get the latest artifact in path.
Using the API I see that one can do something like this:
.sort({"$desc" : ["created"]}).limit(1)
with find.But how to include this when using the library? I'm not sure how to include the sort and limit in the below code.