From d416a27382e8fa46e1451825e9e1c36e6bee1f7c Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Sat, 18 Jan 2025 00:32:49 +0100 Subject: [PATCH] chore(jmespath): add contain() examples --- knowledge base/jmespath.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/knowledge base/jmespath.md b/knowledge base/jmespath.md index e739949..5badff0 100644 --- a/knowledge base/jmespath.md +++ b/knowledge base/jmespath.md @@ -4,6 +4,7 @@ 1. [TL;DR](#tldr) 1. [Further readings](#further-readings) + 1. [Sources](#sources) ## TL;DR @@ -14,7 +15,10 @@ az devops user list --org 'https://dev.azure.com/organizationName' \ items[? startsWith(user.principalName, 'yourNameHere') && \! contains(accessLevel.licenseDisplayName, 'Test plans') - ].user.displayName" + ].user.displayName + " +aws … --query "locations[?name.contains(@, `le`)]" +aws … --query "locations[?name.contains(@, `ue`) || name.contains(@, `ia`)]" # Print an object with specific keys and values from the input. az disk-encryption-set show --ids 'id' \ @@ -27,11 +31,20 @@ az disk-encryption-set show --ids 'id' \ ## Further readings - [Website] +- [Specifications] + +### Sources + +- [Filtering JMESPath with contains] [specifications]: https://jmespath.org/specification.html [website]: https://jmespath.org/ + + +[filtering jmespath with contains]: https://stackoverflow.com/questions/50774937/filtering-jmespath-with-contains#50831828