data-segmenter
is a tool that allows package consumers to define segments from their data regardless of data source like MongoDB or SQL in the backend and provide those segments to a client consumer or user in the frontend.
This package has 3 main APIs:
Allows you to define your segments and their corresponding query builders. A segment should be represented by a query e.g. "I want the segment of my profiles with a {field}
containing {value}
" could be represented as a MongoDb or SQL query returned by your buildQuery
methods.
You would consume this in your backend.
Allow for the composition and manipulation of segments.
You would consume this in your client. It should not know anything of your implementation of the Definition API.
This API should provide only a representation of composed segments without being coupled with the backend implementation.
Parses the composed segments from the Composer, and builds composed queries from it. Implementation is done by consumer.
You would consume this in the backend.
See examples
folder.