ezs
analytics functions.
A collection of This package cannot be used alone. ezs has to be installed
Usage
import ezs from 'ezs';
import analytics from 'ezs-analytics';
ezs.use(analytics);
process.stdin
.pipe(ezs('STATEMENT_NAME', { STATEMENT_PARAMETERS })
.pipe(process.stdout);
Statements
Table of Contents
- count
- distinct
- distribute
- drop
- exploding
- filter
- graph
- greater
- groupingByEquality
- groupingByHamming
- groupingByLevenshtein
- groupingByModulo
- keys
- less
- maximizing
- merging
- minimizing
- pair
- pluck
- reducing
- segment
- slice
- sort
- summing
- topics
- tune
- value
count
Take Object
object getting some fields with json path, and do ...
Parameters
data
feed
-
path
String
Returns Object
distinct
Take Object
object getting some fields with json path, and do ...
Parameters
data
feed
-
path
String path (optional, defaultid
)
Returns Object
distribute
Take Object
like { id, value } and throw a serie of number value
Parameters
data
feed
-
id
String path to use for id (optional, defaultid
) -
value
String path to use for value (optional, defaultvalue
) -
step
String step between each valut (optional, default1
) -
start
Number first value to throw (optional, defaultminvalueinthestream
) -
size
Number size of the distribution (optional, default(minvalue-maxvalue)inthestream
) -
default
Number default value for missing object (optional, default0
)
Returns Object
drop
Take Object
and throw the same object only if there the value of the select field is not equals than a value
Parameters
data
feed
-
path
String path of the field to compare (optional, defaultvalue
) -
if
Number value to compare (optional, default''
)
Returns Object
exploding
Take Object
and take values with [value] path (must be an array)
and throw object of each value. The new object is build with [id] and eac value.
Parameters
data
feed
-
id
String path to use for id (optional, defaultid
) -
value
String path to use for value (optional, defaultvalue
)
Returns Object
filter
Take Object
and throw the same object only if there the value of the select field is equals than a value
Parameters
data
feed
-
path
String path of the field to compare (optional, defaultvalue
) -
if
Number value to compare (optional, default''
)
Returns Object
graph
Take Object
object getting some fields with json path, and do ...
Parameters
data
feed
-
path
String
Returns Object
greater
Take Object
and throw the same object only if there the value of the select field is greater (or equal) than a value
Parameters
data
feed
-
path
String path of the field to compare (optional, defaultvalue
) -
than
Number value to compare (optional, default0
) -
strict
Boolean greater than but not equal (optional, defaultfalse
)
Returns Object
groupingByEquality
Take Object
like { id, value } and reduce all value with the same id in single object
Parameters
data
feed
-
id
String path to use for id (optional, defaultid
) -
value
String path to use for value (optional, defaultvalue
)
Returns Object
groupingByHamming
Take Object
like { id, value } and reduce all value with
ID which have the same Hamming distance in single object
Parameters
data
feed
-
id
String path to use for id (optional, defaultid
) -
value
String path to use for value (optional, defaultvalue
)
Returns Object
groupingByLevenshtein
Take Object
like { id, value } and reduce all value with
ID which have the same Levenshtein distance in single object
Parameters
data
feed
-
id
String path to use for id (optional, defaultid
) -
value
String path to use for value (optional, defaultvalue
) -
distance
Number minimal levenshtein distance to have a same id (optional, default1
)
Returns Object
groupingByModulo
Take Object
like { id, value } and reduce all value with the same modulo comptuation in ansingle object
Parameters
data
feed
-
id
String path to use for id (optional, defaultid
) -
value
String path to use for value (optional, defaultvalue
)
Returns Object
keys
Take Object
and throws all its keys
Parameters
data
feed
-
path
String
Returns Object
less
Take Object
and throw the same object only if there the value of the select field is less (or equal) than a value
Parameters
data
feed
-
path
String path of the field to compare (optional, defaultvalue
) -
than
Number value to compare (optional, default0
) -
strict
Boolean less than but not equal (optional, defaultfalse
)
Returns Object
maximizing
Take special Object
like {id, value} and replace value with the max of values
Parameters
data
feed
-
id
String path to use for id (optional, defaultid
) -
value
String path to use for value (optional, defaultvalue
)
Returns Object
merging
Take special Object
like {id, value} and replace value with the merge of values
Parameters
data
feed
-
id
String path to use for id (optional, defaultid
) -
value
String path to use for value (optional, defaultvalue
)
Returns Object
minimizing
Take special Object
like {id, value} and replace value with the min of values
Parameters
data
feed
-
id
String path to use for id (optional, defaultid
) -
value
String path to use for value (optional, defaultvalue
)
Returns Object
pair
Take Object
object getting some fields with json path, and do ...
Parameters
data
feed
-
path
String
Returns Object
pluck
Take Object
object getting value of fields (with json path)
and throws a object of each value
Parameters
data
feed
-
path
String path to use form group by (optional, defaultid
)
Returns Object
reducing
Take Object
group value of { id, value } objectpath
Parameters
data
feed
-
id
String path to use for id (optional, defaultid
) -
value
String path to use for value (optional, defaultvalue
)
Returns Object
segment
Take Object
object getting some fields with json path, and
throw segment of value. Ex: get [a,b,c] and throw [a,b], [b,c]
Parameters
data
feed
-
path
String path (optional, defaultvalue
) -
aggregate
Boolean aggregate all values for all paths (or not) (optional, defaulttrue
)
Returns Object
slice
Take Object
and throw the same object onl if there in the section of the stream between start and start + size
stream is numbered from 1
Parameters
data
feed
-
start
Number start of the slice (optional, default0
) -
size
Number size of the slice (optional, default10
)
Returns Object
sort
Take all Object
and sort them with dedicated key
Parameters
data
feed
-
path
String path to use for id (optional, defaultid
)
Returns Object
summing
Take special Object
like {id, value} and replace value with the sum of values
Parameters
data
feed
-
id
String path to use for id (optional, defaultid
) -
value
String path to use for value (optional, defaultvalue
)
Returns Object
topics
Take Object
and take values with [value] path (must be an array)
Parameters
data
feed
-
id
String path to use for id (optional, defaultid
) -
value
String path to use for value (optional, defaultvalue
)
Returns Object
tune
Take all Object
and sort them with selected field
Parameters
data
feed
-
path
String path to use for the sort key (optional, defaultid
)
Returns Object
value
Take Object
object and getting the value field
Parameters
data
feed
-
path
String the pah of the value field (optional, defaultvalue
)
Returns Object