-
Notifications
You must be signed in to change notification settings - Fork 26
DOCSP-49849 - Collation #628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,110 @@ | ||||||||||||||||||||||||||||||||||||||||||||||
| To configure collation for your operation, create an instance of the | ||||||||||||||||||||||||||||||||||||||||||||||
| `Collation <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.Collation.html>`__ class. | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| The following table describes the parameters that the ``Collation`` constructor accepts. | ||||||||||||||||||||||||||||||||||||||||||||||
| It also lists the corresponding class property that you can use to read each | ||||||||||||||||||||||||||||||||||||||||||||||
| setting's value. | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| .. list-table:: | ||||||||||||||||||||||||||||||||||||||||||||||
| :header-rows: 1 | ||||||||||||||||||||||||||||||||||||||||||||||
| :widths: 20 60 20 | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| * - Parameter | ||||||||||||||||||||||||||||||||||||||||||||||
| - Description | ||||||||||||||||||||||||||||||||||||||||||||||
| - Class Property | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| * - ``locale`` | ||||||||||||||||||||||||||||||||||||||||||||||
| - | Specifies the International Components for Unicode (ICU) locale. For a list of | ||||||||||||||||||||||||||||||||||||||||||||||
| supported locales, | ||||||||||||||||||||||||||||||||||||||||||||||
| see :manual:`Collation Locales and Default Parameters </reference/collation-locales-defaults/#supported-languages-and-locales>` | ||||||||||||||||||||||||||||||||||||||||||||||
| in the {+mdb-server+} Manual. | ||||||||||||||||||||||||||||||||||||||||||||||
| | | ||||||||||||||||||||||||||||||||||||||||||||||
| | If you want to use simple binary comparison, use the ``Collation.Simple`` static | ||||||||||||||||||||||||||||||||||||||||||||||
| property to return a ``Collation`` object with the ``locale`` set to ``"simple"``. | ||||||||||||||||||||||||||||||||||||||||||||||
| | **Data Type**: {+string-data-type+} | ||||||||||||||||||||||||||||||||||||||||||||||
| - ``Locale`` | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| * - ``alternate`` | ||||||||||||||||||||||||||||||||||||||||||||||
| - | Optional. Specifies whether the driver considers whitespace and punctuation as base | ||||||||||||||||||||||||||||||||||||||||||||||
| characters for purposes of comparison. | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
| | | ||||||||||||||||||||||||||||||||||||||||||||||
| | **Data Type**: `CollationAlternate <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.CollationAlternate.html>`__ | ||||||||||||||||||||||||||||||||||||||||||||||
| | **Default**: ``CollationAlternate.NonIgnorable`` (spaces and punctuation are | ||||||||||||||||||||||||||||||||||||||||||||||
| considered base characters) | ||||||||||||||||||||||||||||||||||||||||||||||
| - ``Alternate`` | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| * - ``backwards`` | ||||||||||||||||||||||||||||||||||||||||||||||
| - | Optional. Specifies whether strings containing diacritics sort from the back of the string | ||||||||||||||||||||||||||||||||||||||||||||||
| to the front. | ||||||||||||||||||||||||||||||||||||||||||||||
| | | ||||||||||||||||||||||||||||||||||||||||||||||
| | **Data Type**: {+bool-data-type+} | ||||||||||||||||||||||||||||||||||||||||||||||
| | **Default**: ``false`` | ||||||||||||||||||||||||||||||||||||||||||||||
| - ``Backwards`` | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| * - ``caseFirst`` | ||||||||||||||||||||||||||||||||||||||||||||||
| - | Optional. Specifies the sort order of case differences during tertiary level comparisons. | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
| | | ||||||||||||||||||||||||||||||||||||||||||||||
| | **Data Type**: `CollationCaseFirst <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.CollationCaseFirst.html>`__ | ||||||||||||||||||||||||||||||||||||||||||||||
| | **Default**: ``CollationCaseFirst.Off`` | ||||||||||||||||||||||||||||||||||||||||||||||
| - ``CaseFirst`` | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| * - ``caseLevel`` | ||||||||||||||||||||||||||||||||||||||||||||||
| - | Optional. Specifies whether to include case comparison at strength level ``Primary`` or | ||||||||||||||||||||||||||||||||||||||||||||||
| ``Secondary``. | ||||||||||||||||||||||||||||||||||||||||||||||
| | | ||||||||||||||||||||||||||||||||||||||||||||||
| | When this argument is ``true``: | ||||||||||||||||||||||||||||||||||||||||||||||
| | | ||||||||||||||||||||||||||||||||||||||||||||||
| | - If the strength is ``Primary``, the driver compares base | ||||||||||||||||||||||||||||||||||||||||||||||
| characters and case. | ||||||||||||||||||||||||||||||||||||||||||||||
| | - If the strength is ``Secondary``, the driver compares base | ||||||||||||||||||||||||||||||||||||||||||||||
| characters, diacritics, other secondary differences, and case. | ||||||||||||||||||||||||||||||||||||||||||||||
| | | ||||||||||||||||||||||||||||||||||||||||||||||
| | When this argument is ``false``, the driver doesn't include case comparison at | ||||||||||||||||||||||||||||||||||||||||||||||
| strength level ``Primary`` or ``Secondary``. | ||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||
| - | Optional. Specifies whether to include case comparison at strength level ``Primary`` or | |
| ``Secondary``. | |
| | | |
| | When this argument is ``true``: | |
| | | |
| | - If the strength is ``Primary``, the driver compares base | |
| characters and case. | |
| | - If the strength is ``Secondary``, the driver compares base | |
| characters, diacritics, other secondary differences, and case. | |
| | | |
| | When this argument is ``false``, the driver doesn't include case comparison at | |
| strength level ``Primary`` or ``Secondary``. | |
| - | Optional. Specifies whether to include case comparison. | |
| | | |
| | When this argument is ``true``, the behaviour depends on the value of the ``Strength`` property: | |
| | | |
| | - If the ``Strength`` property is ``Primary``, the driver compares base | |
| characters and case. | |
| | - If the ``Strength`` property is ``Secondary``, the driver compares base | |
| characters, diacritics, other secondary differences, and case. | |
| | | |
| | When this argument is ``false``, the driver doesn't include case comparison. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know of a way to link to another table row. I could move strength above caseLevel but I just moved them to parameter order and that would throw it off.
a note about the properties: they're read-only and set directly by these parameters, so i talk about the values of the parameters instead of the values of the properties.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add **Accepted Values:**
| - | Optional. Specifies which characters the driver considers ignorable when | |
| ``Alternate`` is ``CollationAlternate.Shifted``. | |
| - | Optional. Specifies which characters the driver considers ignorable when the | |
| ``Alternate`` property is ``CollationAlternate.Shifted``. |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add an example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about a link to the ICU docs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're not being treated as strings so I would leave out the "s, you could make them 10 and 2 if you want to differentiate them:
| | If this argument is ``true``, the driver compares numeric strings as numbers. | |
| For example, "10" is greater than "2". If this argument is ``false`` or excluded, | |
| the driver compares numeric strings as strings. For example, "10" is less than "2". | |
| | If this argument is ``true``, the driver compares numeric strings as numbers. | |
| For example, 10 is greater than 2. | |
| | | |
| | If this argument is ``false`` or excluded, | |
| the driver compares numeric strings as strings. For example, "10" is less than "2". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they aren't being compared as strings, but they still are strings, so i think the quotes are useful. lmk if this change is clearer.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
404
| For more information about collation, see the :manual:`Collation <reference/collation>` | |
| page in the {+mdb-server+} manual. | |
| For more information about collation, see the :manual:`Collation </reference/collation>` | |
| page in the {+mdb-server+} manual. |
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this still being used?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, it's the page template for update-many and update-one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other table in this doc set uses italics for
*Optional.*, but the style guide uses(*Optional)*I'll leave it up to you.