I have records in Artifactory like this:
{
"path": "amc-sw/pcm33/pcm21/system-pcm33-20221017104012.raucb",
"type": "file",
Now I want to match all records having pcm21 in the path.
I run this query and it gives me a lot of records
"files": [
{
"aql": {
"items.find": {
"repo": "amc-sw",
"$and": [
{
"$and": [
{
"path": {
"$match": "*pcm21/*"
}
} ] } ] } } } ] }
jf rt search --spec query.json --url=$ARTIFACTORY_URL --user=$ARTIFACTORY_USER --access-token=$ARTIFACTORY_PASS
Changing the match to this also gives a lot of records
"$match": "*/pcm21*"
But this gives me exactly zero records
"$match": "*/pcm21/*"
Why can't I use two slashes in the matching?
The reason behind
"$match": "*/pcm21/*"returning 0 results derives from the path structure"path": "amc-sw/pcm33/pcm21/system-pcm33-20221017104012.raucb",The file
system-pcm33-20221017104012.raucbcomes right after the deepest folder which is pcm21.The match structure with ending forward slash requires an additional directory after the pcm21.
assuming the path would have been
amc-sw/pcm33/pcm21/inner-path/system-pcm33-20221017104012.raucbthe query would return:
}