Collation Locales and Default Parameters

New in version 3.4.

Collation allows users to specify language-specific rules for string comparison, such as rules for lettercase and accent marks.

Behavior

Some collation locales have variants, which employ special language-specific rules. To specify a locale variant, use the following syntax:

{ "locale" : "<locale code>@collation=<variant>" }

For example, to use the unihan variant of the Chinese collation:

{ "locale" : "[email protected]=unihan" }

See the collation page for a full description of collation behavior and syntax.

Supported Languages and Locales

MongoDB’s collation feature supports the following languages. The following table lists the supported languages and the associated locales as defined by ICU Locale ID . [1]

Language Locale Variants
Afrikaans af  
Albanian sq  
Amharic am  
Arabic ar compat
Armenian hy  
Assamese as  
Azeri az search
Bengali bn  
Belarusian be  
Bengali bn traditional
Bosnian bs search
Bosnian (Cyrillic) bs_Cyrl  
Bulgarian bg  
Burmese my  
Catalan ca search
Cherokee chr  
Chinese zh
big5han
gb2312han
unihan
zhuyin
Chinese (Traditional) zh_Hant  
Croatian hr search
Czech cs search
Danish da search
Dutch nl  
Dzongkha dz  
English en  
English (United States) en_US  
English (United States, Computer) en_US_POSIX  
Esperanto eo  
Estonian et  
Ewe ee  
Faroese fo  
Filipino fil  
Finnish fi
search
traditional
French fr  
French (Canada) fr_CA  
Galician gl search
Georgian ka  
German de
search
eor
phonebook
German (Austria) de_AT phonebook
Greek el  
Gujarati gu  
Hausa ha  
Hawaiian haw  
Hebrew he search
Hindi hi  
Hungarian hu  
Icelandic is search
Igbo ig  
Inari Sami smn search
Indonesian id  
Irish ga  
Italian it  
Japanese ja unihan
Language Locale Variants
Kalaallisut kl search
Kannada kn traditional
Kazakh kk  
Khmer km  
Konkani kok  
Korean ko
search
searchjl
unihan
Kyrgyz ky  
Lakota lkt  
Lao lo  
Latvian lv  
Lingala ln phonetic
Lithuanian lt  
Lower Sorbian dsb  
Luxembourgish lb  
Macedonian mk  
Malay ms  
Malayalam ml  
Maltese mt  
Marathi mr  
Mongolian mn  
Nepali ne  
Northern Sami se search
Norwegian Bokmål nb search
Norwegian Nynorsk nn search
Oriya or  
Oromo om  
Pashto ps  
Persian fa  
Persian (Afghanistan) fa_AF  
Polish pl  
Portuguese pt  
Punjabi pa  
Romanian ro  
Russian ru  
Serbian sr  
Serbian (Latin) sr_Latn search
Sinhala si dictionary
Slovak sk search
Slovenian sl  
Spanish es
search
traditional
Swahili sw  
Swedish sv search
Tamil ta  
Telugu te  
Thai th  
Tibetan bo  
Tongan to  
Turkish tr search
Ukrainian uk  
Upper Sorbian hsb  
Urdu ur  
Uyghur ug  
Vietnamese vi traditional
Walser wae  
Welsh cy  
Yiddish yi search
Yoruba yo  
Zulu zu  

Tip

To explicitly specify simple binary comparison, specify locale value of "simple".

[1] To request support for a locale, please f