View Source FatEcto.FatQuery.WhereableHelper (FatEcto v1.0.0)
Provides helper functions for filtering and processing query parameters.
Summary
Functions
Filters fields in params
based on the provided filterable_fields
map.
Filters overrideable fields based on the provided overrideable_fields
list and ignoreable_fields_values
.
Removes fields from where_params
if their values match any of the values in ignoreable_fields_values
.
Functions
Filters fields in params
based on the provided filterable_fields
map.
Parameters
- params: A map containing the fields, operators, and values to filter.
- filterable_fields: A map containing allowed fields and their corresponding operators.
Returns
A filtered map containing only the fields and operators that are allowed.
Filters overrideable fields based on the provided overrideable_fields
list and ignoreable_fields_values
.
Parameters
- params: A map containing the fields, operators, and values to filter.
- overrideable_fields: A list of fields that can be overridden.
- ignoreable_fields_values: A map containing fields and their ignoreable values.
Returns
A list of maps containing filtered fields, operators, and values.
Removes fields from where_params
if their values match any of the values in ignoreable_fields_values
.
Parameters
- where_params: A map containing the fields, operators, and values to filter.
- ignoreable_fields_values: A map containing fields and their ignoreable values (can be a single value or a list of values).
Returns
A filtered map with ignoreable fields removed.