Filters
Overview
The filters object facilitates the querying of data by accepting key-value pairs, enabling a flexible approach to data retrieval based on diverse conditions.
Filter Object
The filter object is designed to allow users to specify conditions for querying data. It includes several key-value pairs, each representing a different filtering condition. Here are the available operators in the filter object:
- prefix: Specifies a prefix to search for within the data.
- suffix: Specifies a suffix to search for within the data.
- eq: Matches exact values.
- neq: Matches values that are not equal.
- in: Matches values that are included in a provided list.
- nin: Matches values that are not included in a provided list.
- gt: Matches values that are greater than a provided value.
- gte: Matches values that are greater than or equal to a provided value.
- lt: Matches values that are less than a provided value.
- lte: Matches values that are less than or equal to a provided value.
- sw: Matches values that start with a provided string.
- exists: Matches values that exist.
note
All the conditions are used in conjunction
- Below are the operators available for filtering an object. For more info please check any filter endpoint. Example here
Usage
To use the filter object effectively, users must follow the correct payload format. Each filter condition should be sent in the following format:
- Example
- Considering the user want to filter all the customer objects with below conditions
customerIdnot equal todummy-customer-IdcustomerTypeequal toCompanyemailequal totest@ranadev.iophoneNumbernot in+1459875794, +12749304057
- Considering the user want to filter all the customer objects with below conditions
User must send the request with below Query params
filters[customerId][neq]=dummy-customer-Id&filters[customerType][eq]=Company&filters[email][prefix]=companyDetails&filters[email][eq]=test@ranadev.io&filters[phoneNumber][prefix]=companyDetails&filters[phoneNumber][nin]=+1459875794, +12749304057
note
Please note the prefix value added in the above query the customer object based on a nested object