Navigation

Set Language Specific Rules for String Comparison

Important

This feature is unavailable in MongoDB Compass Community Edition.

Use the Collation query bar option to specify language-specific rules for string comparison, such as rules for lettercase and accent marks.

Set Collation

  1. Click Options.

  2. Enter the locale field in the collation document to specify the ICU Locale code for the desired language in the Collation field.

    Example

    To use the pinyin variant of the Chinese collation, use the following collation document:

    { "locale" : "zh@collation=pinyin" }
    

    As you type, the Find button is disabled and the Collation label turns red until a valid query is entered.

  3. Click Find to run the query and view the updated results.

    Note

    For query result sets larger than 1000 documents, Compass shows a sampling of the results. Otherwise, Compass shows the entire result set.

    For details on sampling, see the FAQ.

Clear the Query

To clear the query bar and the results of the query, click Reset.

To Learn More

  • See the supported languages and locales section in the MongoDB Manual.
  • See the possible fields in a collation document in the MongoDB Manual.