Skip to content
nntrn edited this page Sep 19, 2023 · 1 revision

(
  [ "type1", "type2", "type3" ] |
  INDEX( .[]; . )
) as $lkup 
map( select($lkup[ .type_identifier]))   

Input

[ {"name": "Foo", "is_open": true, "type_identifier": "type4"},
  {"name": "Bar", "is_open": true, "type_identifier": "type5"},
  {"name": "Some store", "is_open": false, "type_identifier": "type2"}]

Output

[
  {
    "name": "Some store",
    "is_open": false,
    "type_identifier": "type2"
  }
]
Clone this wiki locally