Fork me on GitHub

filter

Takes a json object, and considers each field to be a separate datapoint’s data. It removes all elements for which its first argument returns true (filters).

filter allows you to remove values from an object based upon a condition. For example:

[{
  "a": 45,
  "b": 23,
  "c": -3
}]

Running the transform filter($<0) on the above datapoint, will give an output:

[{
  "a": 45,
  "b": 23
}]

The transform “filtered” out all values that are less than 0.

Examples

The main use case of the filter transform is in combination with the map transform, when map returns too many values. For example, if looking at browsing history, you might have visited thousands of websites, but only be interested in the ones you visited more than 30 times:

map(domain,count) | filter($<=30)

Transform Details

One-To-OneStatelessPeekInput SchemaOutput Schema
TrueFalseFalse

Arguments

#DescriptionOptionalConstantHijackedDefault
1The script to instantiate to perform on all elements of input, one at a time.FalseFalseTrue

This Site

Contribute

ConnectorDB is a very new open-source project. If you are a designer/developer or ML enthusiast, head on over to the connectordb github, where you can choose which part of ConnectorDB you want to contribute towards! Pull requests or bug reports are welcome!