JMESPath按数组中的日期过滤

时间:2019-08-20 15:34:11

标签: jmespath

我想查找所有endDate都低于特定日期的所有条目。

我上班的确是这样的:

[?parentalControlSettings.legalAgeGroupRule=='Allow'].{id: appId, displayName: displayName, secretsCount: length(passwordCredentials), endDates: passwordCredentials[*].endDate}

我想要类似passwordCredentials.endDate<='2020-31-15T09:54:51.603361+00:00'的东西 但是,即使像contains(2019)之类的东西也可以。

这是我的数据

[
    {
        "appId": "d172bbcb-4f30-49c6-a42e-496b4fdcd0b4",
        "displayName": "myApp",
        "parentalControlSettings": {
            "countriesBlockedForMinors": [],
            "legalAgeGroupRule": "Allow"
        },
        "passwordCredentials": [
            {
                "additionalProperties": null,
                "customKeyIdentifier": null,
                "endDate": "2117-11-15T09:54:51.603361+00:00",
                "keyId": "f327e987-176a-4bc2-b733-4b0bd19e8b83",
                "startDate": "2017-11-15T09:54:51.603361+00:00",
                "value": null
            },
            {
                "additionalProperties": null,
                "customKeyIdentifier": null,
                "endDate": "2019-11-15T09:54:51.603361+00:00",
                "keyId": "f327e987-176a-4bc2-b733-4b0bd19e8b83",
                "startDate": "2017-11-15T09:54:51.603361+00:00",
                "value": null
            }
        ]
    }
]

0 个答案:

没有答案