Docs Home / Compass / Create an Aggregation Pipeline

Specify Custom Collation For Your Pipeline

Use custom collation to specify language-specific rules for string comparison, such as rules for letter case and accent marks, within your aggregation pipeline.

About this Task

When entering a collation document, the locale field is mandatory. Default collation field values vary depending on which locale you specify. To learn more about supported languages and locales, see Collation Locales and Default Parameters.

Steps

1

Click Options

In the top-right corner of the pipeline builder, click Options.

undefinedMore Options
2

Enter your collation document

Next to the Collation field, enter your collation document.

After you enter your collation document, the aggregation pipeline builder considers the language-specific rules that you specified in your document.

Example

The following sample collation document specifies French as the chosen locale and sorts uppercase letters before lowercase letters with the caseFirst field:

{
locale: "fr",
caseFirst: "upper"
}

Learn More