Constructor
new DataTable(queryString, options)
- Description:
Constructor
- Source:
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}
- Description:
Returns the search field for. Only for internal use.
- Source:
Returns:
Regex object or search term itself
- Type
- object | string
getAggregationPipeline(options) → {object}
- Description:
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.
- Source:
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | Wraps options Properties
|
Returns:
Pipeline object
- Type
- object
getProcessedResult(queryResult, processFn) → {object|Array.<string>}
- Description:
Processes the aggregation result and returns a ready-to-use response.
- Source:
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.<string>