ezs-analytics v1.8.1
A collection of ezs analytics functions.
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
datafeedpathString
Returns Object
distinct
Take Object object getting some fields with json path, and do ...
Parameters
datafeedpathString path (optional, defaultid)
Returns Object
distribute
Take Object like { id, value } and throw a serie of number value
Parameters
datafeedidString path to use for id (optional, defaultid)valueString path to use for value (optional, defaultvalue)stepString step between each valut (optional, default1)startNumber first value to throw (optional, defaultminvalueinthestream)sizeNumber size of the distribution (optional, default(minvalue-maxvalue)inthestream)defaultNumber 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
datafeedpathString path of the field to compare (optional, defaultvalue)ifNumber 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
datafeedidString path to use for id (optional, defaultid)valueString 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
datafeedpathString path of the field to compare (optional, defaultvalue)ifNumber value to compare (optional, default'')
Returns Object
graph
Take Object object getting some fields with json path, and do ...
Parameters
datafeedpathString
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
datafeedpathString path of the field to compare (optional, defaultvalue)thanNumber value to compare (optional, default0)strictBoolean 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
datafeedidString path to use for id (optional, defaultid)valueString 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
datafeedidString path to use for id (optional, defaultid)valueString 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
datafeedidString path to use for id (optional, defaultid)valueString path to use for value (optional, defaultvalue)distanceNumber 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
datafeedidString path to use for id (optional, defaultid)valueString path to use for value (optional, defaultvalue)
Returns Object
keys
Take Object and throws all its keys
Parameters
datafeedpathString
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
datafeedpathString path of the field to compare (optional, defaultvalue)thanNumber value to compare (optional, default0)strictBoolean 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
datafeedidString path to use for id (optional, defaultid)valueString 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
datafeedidString path to use for id (optional, defaultid)valueString 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
datafeedidString path to use for id (optional, defaultid)valueString path to use for value (optional, defaultvalue)
Returns Object
pair
Take Object object getting some fields with json path, and do ...
Parameters
datafeedpathString
Returns Object
pluck
Take Object object getting value of fields (with json path)
and throws a object of each value
Parameters
datafeedpathString path to use form group by (optional, defaultid)
Returns Object
reducing
Take Object group value of { id, value } objectpath
Parameters
datafeedidString path to use for id (optional, defaultid)valueString 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
datafeedpathString path (optional, defaultvalue)aggregateBoolean 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
datafeedstartNumber start of the slice (optional, default0)sizeNumber size of the slice (optional, default10)
Returns Object
sort
Take all Object and sort them with dedicated key
Parameters
datafeedpathString 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
datafeedidString path to use for id (optional, defaultid)valueString path to use for value (optional, defaultvalue)
Returns Object
topics
Take Object and take values with value path (must be an array)
Parameters
datafeedidString path to use for id (optional, defaultid)valueString path to use for value (optional, defaultvalue)
Returns Object
tune
Take all Object and sort them with selected field
Parameters
datafeedpathString path to use for the sort key (optional, defaultid)
Returns Object
value
Take Object object and getting the value field
Parameters
datafeedpathString the pah of the value field (optional, defaultvalue)
Returns Object