Skip to content

How to style a map key #1678

Answered by mikefarah
unmarshall asked this question in Q&A
Discussion options

You must be logged in to vote

Yep - you can use the "key" operator to work with the key of a map. To set the style of the key you can:

.features.f3 | key style |= "double"

This can be put together with assigning the value true using with

'with(.features.f3; . = true | key style= "double")'
  • with changed the context to .feaures.f3
  • . = true, the . refers to the current node, which is the value
  • key style= "double", key will get the key node of the value, style= will update the style

Hope that makes sense!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by unmarshall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #1677 on May 28, 2023 02:12.