Constructor
new DataTable(queryString, options)
- Source:
Constructor
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
queryString |
Object | This object should contain the datatable arguments like iDisplayStart, iDisplayEnd, etc. These are added to request by DataTables automatically. If you have a different use-case, please make sure that the object has necessary fields. Properties
|
|||||||||||||||||||||||||||
options |
Object | Wraps options Properties
|
Methods
_getSearchField() → {Object|String}
- Source:
Returns the search field for. Only for internal use.
Returns:
Regex object or search term itself
- Type
- Object | String
getAggregationPipeline(options) → {Object}
- Source:
Creates an aggregation pipeline based on the query string and additional stages/facets if provided any. Data flow between stages are not checked, so please do check manually.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Wraps options Properties
|
Returns:
Pipeline object
- Type
- Object
getProcessedResult(queryResult, processFn) → {Object|Array}
- Source:
Processes the aggregation result and returns a ready-to-use response.
Parameters:
Name | Type | Description |
---|---|---|
queryResult |
Object | Aggregation result returned by the MongoDB. |
processFn |
function | A callback function that has a single argument 'rows'. As the name implies, it is an array of returned rows. The function can be used as a final stage to do modifications to fetched items before completing the response. |
Returns:
Returns the final response
- Type
- Object | Array