Function searchByLanguage

  • Type Parameters

    Parameters

    • language: string

      The language 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 language

    Example

    const countries = await searchByLanguage('english');
    const countries = await searchByLanguage('english', { fields: ['name', 'capital'] });