Function searchByTranslation

  • Type Parameters

    Parameters

    • translation: string

      The translation to search for

    • Optional options: {
          fields?: F[];
      }

      The options

      • Optional fields?: F[]

        The fields to keep in the response

    Returns Promise<Nullable<Pick<Country, F>[]>>

    The matching countries

    Description

    Search among the countries by their translation

    Example

    const countries = await searchByTranslation('الولايات المتحدة');
    const countries = await searchByTranslation('الولايات المتحدة', { fields: ['name', 'capital'] });