Skip to main content

Distinct

Basic

This method interacts with the Basic Distinct endpoint to find the distinct values for a specified field.

Usage

const response = await userService.distinct('name');

Parameters

ParameterTypeDescription
fieldstringThe field for which distinct values are to be retrieved.
axiosRequestConfigAxiosRequestConfig (optional)Axios request configuration for fine-tuning the HTTP request.

Response

PropTypeDescription
successbooleanIndicates whether the request was successful.
statusnumberHTTP status code of the response.
messagestringA message providing additional information about the response, especially in case of errors.
rawarray[string]The distinct values for the specified field.
dataarray[string]The distinct values for the specified field.
headersobject[AxiosHeaders]Axios headers associated with the response.
{
success: true,
status: 200,
raw: ['John', 'Ella'],
data: ['John', 'Ella'],
headers: Object [AxiosHeaders] {}
}

Advanced

This method interacts with the Advanced Distinct endpoint to find the distinct values for a specified field with advanced options.

Usage

const response = await userService.distinctAdvanced('name', { public: true });

Parameters

ParameterTypeDescription
fieldstringThe field for which distinct values are to be retrieved.
conditionsFilterQueryAdvanced filter conditions to narrow down the resources.
axiosRequestConfigAxiosRequestConfig (optional)Axios request configuration for fine-tuning the HTTP request.

Response

PropTypeDescription
successbooleanIndicates whether the request was successful.
statusnumberHTTP status code of the response.
messagestringA message providing additional information about the response, especially in case of errors.
rawarray[string]The distinct values for the specified field.
dataarray[string]The distinct values for the specified field.
headersobject[AxiosHeaders]Axios headers associated with the response.
{
success: true,
status: 200,
raw: ['John', 'Ella'],
data: ['John', 'Ella'],
headers: Object [AxiosHeaders] {}
}