0

I am trying to filter a list of objects with jmes,

so far, I am able to filter a quite big datasructure, so I get a list of a structure like this:

[{
    id: "foo"
    name: "bar"
    targets: ["something", "somethingelse", "blabla"]
}, ...]

what I need, is to filter this list so I only get the elements that contain "blabla" in the targets array. I donĀ“t seem to find such a thing. What is the proper way of implementing such a filter? All the infos I find are for filtering an array that contains key/value pairs...

Martin
  • 2,894
  • 22
  • 37

1 Answers1

3

I think you want:

[?contains(targets, 'blabla')]

See http://jmespath.org/specification.html#built-in-functions for all available functions.

james.haggerty
  • 1,090
  • 6
  • 10