MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / Collation

Class Collation

pymongo/collation.py:99–214  ·  view source on GitHub ↗

Collation :param locale: (string) The locale of the collation. This should be a string that identifies an `ICU locale ID` exactly. For example, ``en_US`` is valid, but ``en_us`` and ``en-US`` are not. Consult the MongoDB documentation for a list of supported locales.

Source from the content-addressed store, hash-verified

97
98
99class Collation:
100 """Collation
101
102 :param locale: (string) The locale of the collation. This should be a string
103 that identifies an `ICU locale ID` exactly. For example, ``en_US`` is
104 valid, but ``en_us`` and ``en-US`` are not. Consult the MongoDB
105 documentation for a list of supported locales.
106 :param caseLevel: (optional) If ``True``, turn on case sensitivity if
107 `strength` is 1 or 2 (case sensitivity is implied if `strength` is
108 greater than 2). Defaults to ``False``.
109 :param caseFirst: (optional) Specify that either uppercase or lowercase
110 characters take precedence. Must be one of the following values:
111
112 * :data:`~CollationCaseFirst.UPPER`
113 * :data:`~CollationCaseFirst.LOWER`
114 * :data:`~CollationCaseFirst.OFF` (the default)
115
116 :param strength: Specify the comparison strength. This is also
117 known as the ICU comparison level. This must be one of the following
118 values:
119
120 * :data:`~CollationStrength.PRIMARY`
121 * :data:`~CollationStrength.SECONDARY`
122 * :data:`~CollationStrength.TERTIARY` (the default)
123 * :data:`~CollationStrength.QUATERNARY`
124 * :data:`~CollationStrength.IDENTICAL`
125
126 Each successive level builds upon the previous. For example, a
127 `strength` of :data:`~CollationStrength.SECONDARY` differentiates
128 characters based both on the unadorned base character and its accents.
129
130 :param numericOrdering: If ``True``, order numbers numerically
131 instead of in collation order (defaults to ``False``).
132 :param alternate: Specify whether spaces and punctuation are
133 considered base characters. This must be one of the following values:
134
135 * :data:`~CollationAlternate.NON_IGNORABLE` (the default)
136 * :data:`~CollationAlternate.SHIFTED`
137
138 :param maxVariable: When `alternate` is
139 :data:`~CollationAlternate.SHIFTED`, this option specifies what
140 characters may be ignored. This must be one of the following values:
141
142 * :data:`~CollationMaxVariable.PUNCT` (the default)
143 * :data:`~CollationMaxVariable.SPACE`
144
145 :param normalization: If ``True``, normalizes text into Unicode
146 NFD. Defaults to ``False``.
147 :param backwards: If ``True``, accents on characters are
148 considered from the back of the word to the front, as it is done in some
149 French dictionary ordering traditions. Defaults to ``False``.
150 :param kwargs: Keyword arguments supplying any additional options
151 to be sent with this Collation object.
152
153 .. versionadded: 3.4
154
155 """
156

Callers 11

test_reprMethod · 0.90
test_constructorMethod · 0.90
setUpMethod · 0.90
test_collationMethod · 0.90
test_collationMethod · 0.90
test_constructorMethod · 0.90
asyncSetUpMethod · 0.90
test_collationMethod · 0.90
test_collationMethod · 0.90

Calls

no outgoing calls

Tested by 11

test_reprMethod · 0.72
test_constructorMethod · 0.72
setUpMethod · 0.72
test_collationMethod · 0.72
test_collationMethod · 0.72
test_constructorMethod · 0.72
asyncSetUpMethod · 0.72
test_collationMethod · 0.72
test_collationMethod · 0.72