Fork me on GitHub

$

Identity transform - gives the current datapoint in sequence (or if given argument, a sub-object). Useful when performing comparisons ($ < 5)

The identity transform is a placeholder for the “current datapoint”. It returns whatever is passed from the stream.

Suppose your stream has the following data:

44,18,20,-35,20.23

The $ transform will simply return your data unchanged:

44,18,20,-35,20.23

Usage

The identity transform is perhaps the most used transform in all of pipescript. It is frequently used in comparisons and if filters.

For example, the transform $ > 20 is a comparison - it checks whether the current datapoint, represented by the identity is greater than 20. The result of this transform would be:

true,false,false,false,true

This is frequently used in filters: if $ > 20 would return

44,20.23

Objects

The $ transform accepts an optional argument. Sometimes, a datapoint isn’t just your data - it can be an object:

{"hi": "hello","foo":"bar"}, {"hi":"world","foo":"baz"}

Running this transform:

$("hi")

gives us:

"hello","world"

The $ transform is the main method for accessing sub-elements of a datapoint. It also works for array indices.


Transform Details

One-To-OneStatelessPeekInput SchemaOutput Schema
TrueTrueFalse

Arguments

#DescriptionOptionalConstantHijackedDefault
1The subobject to return. For use in json-object type data.TrueTrueFalse

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!