Property | Description | Default | Type | Required |
---|---|---|---|---|
filters | Filters to be applied within this stage | - | array of DynamicFilter | No, but if added minimum 1 item) |
type | Stage class name | - | string | Yes |
enable | Enable stage for execution | true | boolean | No |
name | Name for this specific stage | "filters" | string | No |
save_to_intermediate | If true, the result of the stage will be stored in the intermediate instead of the final section | false | boolean | No |
expand_result | Indicates if the result of this stage should be expanded into the final data dictionary instead of being appended as usual | false | boolean | No |
ui_only | Section specific for UI configuration that affects the process of the stage | object | No | |
halt_on_exception | Indicates if the pipeline should be interrupted in case of an exception | false | boolean | No |
engine_name | Name of the engine to use for this query. If none is provided, the default engine will be used | string | No | |
add_user_filter | If enabled, the stage will add a filter using the credentials in the request, using the user_value and user_filter_field properties | false | boolean | No |
user_value | Field in the request's credentials to be used as the filter value | - | string | No |
user_filter_field | Field for the filter in which the user_value must appear | string | No | |
filter_keys | List of keys where filters are stored for compilation into a single filter entry | [] | array of strings | No |
filter_by_id_field | Field in which the filter by ID will work on | "_id" | string | No |
Parameter | Description |
---|---|
filters | Filters to be applied within this stage. Should be provided as an array of DynamicFilters objects or a JSON representation of the filters. |
filter_ids | A list of IDs used for filtering. When provided, it generates a filter based on the specified IDs. |
filter_keys | A list of keys where filters are stored for compilation into a single filter entry. For each key, the Filter stage retrieves a list of DynamicFilters or a JSON representation of the filters. |
Remember that the intermediate can be fill with either other stages or the original request body that trigger the pipeline, making this essentially REST API parameters
_filter_stage = FilterStage( enable=True, name='filters', engine_name=DEFAULT_ENGINE_NAME, save_to_intermediate=False, expand_result=False, filters=[ TermFilter(field='adult', negated=False, must=True, value=False, multi_select=False) ], add_user_filter=True, user_value='id', user_filter_field='owner', filter_keys=['filters_a', 'filters_b'], filter_by_id_field='doc_id' )