ArrayOfObjectsFilterByKeyValue Op

ArrayOfObjectsFilterByKeyValue

filter key value pairs in objects in an array of objects


<p>Use this op to &quot;slim&quot; an array of objects.</p> <p>Only keep objects that have specified key-value pair!</p> <pre><code>var arr = [ { animal: &quot;dog&quot;, food: &quot;veggies&quot; }, { animal: &quot;cat&quot;, food: &quot;bird&quot; }, { animal: &quot;bird&quot;, food: &quot;veggies&quot; } ];

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

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

// inverting the operation, the array becomes

arr = [{ animal: &quot;cat&quot;, food: &quot;bird&quot; }]; </code></pre>


Full Name
  • Ops.Array.ArrayOfObjectsFilterByKeyValue
Visibility
  • Core Op - Official cables op
License
  • MIT
Authorgithub


INPUT PORTS


Array (Array)

<p>Array input</p>

Filter Key (String)

<p>key to use</p>

Filter Value (String)

<p>value to use</p>

Invert Filter (Number:

<i>boolean</i>

)

<p>invert result (discard all objects that have key-value pair)</p>

OUTPUT PORTS


arrayOut (Array)

<p>output array</p>


Patches using ArrayOfObjectsFilterByKeyValue

  • Examples
  • Public
  • My Patches

Changelog


created opuser avatarsimod - 2020-04-14 13:29
Ops.User.simod.ArrayOfObjectsFilterByKey renamed to Ops.User.simod.ArrayOfObjectsFilterByKeyValueuser avatarsimod - 2020-04-14 14:25
Ops.User.simod.ArrayOfObjectsFilterByKeyValue renamed to Ops.Array.ArrayOfObjectsFilterByKeyValueuser avatarsimod - 2020-04-14 17:31