ArrayOfObjectsFilterByKeyValue_v2 Op

ArrayOfObjectsFilterByKeyValue

filter key value pairs in objects in an array of objects


Use this op to "slim" an array of objects.

Only keep objects that have specified key-value pair!

var arr = [
  { animal: "dog", food: "veggies" }, 
  { animal: "cat", food: "bird" }, 
  { animal: "bird", food: "veggies" }
];

// specifying key value pair food, veggies, the resulting array becomes

arr = [{ animal: "dog", food: "veggies" }, { animal: "bird", food: "veggies"}];

// inverting the operation, the array becomes

arr = [{ animal: "cat", food: "bird" }];

Full Name
  • Ops.Array.ArrayOfObjectsFilterByKeyValue_v2
Visibility
  • Core Op - visible for everyone
License
  • MIT
AuthorgithubMaintained by Team


INPUT PORTS


Array (Array)

Array input

Filter Key (String)

key to use

Filter Value (String)

value to use

Invert Filter (Number: boolean)

invert result (discard all objects that have key-value pair)

OUTPUT PORTS


arrayOut (Array)

output array


 

Patches using ArrayOfObjectsFilterByKeyValue_v2

  • Examples
  • Public
  • My Patches

Changelog


created opuser avatarsimod - 2020-04-14 13:29
improvementfilter array even with empty or null seachvalue, do no longer return full arrayuser avatarstephan - 2025-01-23 17:11