i have this dataset
{
"imageDetails": [
{
"registryId": "259611133533",
"repositoryName": "core",
"imageDigest": "sha256:3585b2754d8429cef04909b97dcc1bf5eacb74bf1c18718a3d602fbc639decf5",
"imageTags": [
"DEV16419adddockerpullforimageused-202404241351"
],
"imageSizeInBytes": 471224049,
"imagePushedAt": "2024-04-24T15:56:39+02:00",
"imageManifestMediaType": "application/vnd.docker.distribution.manifest.v2+json",
"artifactMediaType": "application/vnd.docker.container.image.v1+json"
},
{
"registryId": "259611133533",
"repositoryName": "core",
"imageDigest": "sha256:b17e3f35ff2e0b9af437372d7777e1cc092994eb87dbddf2d73d467eb122cf51",
"imageTags": [
"master-202404300732"
],
"imageSizeInBytes": 470904068,
"imagePushedAt": "2024-04-30T09:34:19+02:00",
"imageManifestMediaType": "application/vnd.docker.distribution.manifest.v2+json",
"artifactMediaType": "application/vnd.docker.container.image.v1+json"
},
{
"registryId": "259611133533",
"repositoryName": "core",
"imageDigest": "sha256:dfe2a1df2d6d8b39bdd37887979f027de29f802295e1b7536c31ac786fc0bbea",
"imageTags": [
"develop-202404230503"
],
"imageSizeInBytes": 471216957,
"imagePushedAt": "2024-04-23T07:07:14+02:00",
"imageManifestMediaType": "application/vnd.docker.distribution.manifest.v2+json",
"artifactMediaType": "application/vnd.docker.container.image.v1+json",
"lastRecordedPullTime": "2024-04-24T08:55:56.071000+02:00"
},
{
"registryId": "259611133533",
"repositoryName": "core",
"imageDigest": "sha256:da82d9236a5bff64a994aee120a3c2be72601e7f36db1581cc6a009e12fc39ca",
"imageTags": [
"develop-202404260502"
],
"imageSizeInBytes": 471225444,
"imagePushedAt": "2024-04-26T07:03:58+02:00",
"imageManifestMediaType": "application/vnd.docker.distribution.manifest.v2+json",
"artifactMediaType": "application/vnd.docker.container.image.v1+json",
"lastRecordedPullTime": "2024-04-27T06:30:55.055000+02:00"
},
{
"registryId": "259611133533",
"repositoryName": "core",
"imageDigest": "sha256:39239ba86a543aa6787da0a02479d6f59eb00742e4810a9d4b52f1423a5e0392",
"imageTags": [
"master-202404260911"
],
"imageSizeInBytes": 470843809,
"imagePushedAt": "2024-04-26T11:12:51+02:00",
"imageManifestMediaType": "application/vnd.docker.distribution.manifest.v2+json",
"artifactMediaType": "application/vnd.docker.container.image.v1+json",
"lastRecordedPullTime": "2024-04-26T11:14:06.695000+02:00"
}
]}
And i want to filter the dataset by imagePushedAt and imageTags which should contain the string master.
I’ve tested the following
imageDetails[?imagePushedAt<`2024-04-27` && imageDetails.contains(@, `master`)]
But unfortunately this doesn’t work.
I in some way got what i wanted by using this query
imageDetails[?imagePushedAt < `2024-04-27`] | [].imageTags[?contains(@,`master`)]
but this solution returns empty array when the imageTags doesn’t match instead of filtering out the result