#include <userver/storages/mongo/options.hpp>
Specifies collation options for text comparison.
Definition at line 317 of file options.hpp.
Public Types | |
enum class | Strength { kPrimary = 1 , kSecondary = 2 , kTertiary = 3 , kQuaternary = 4 , kIdentical = 5 } |
enum class | CaseFirst { kOff , kUpper , kLower } |
enum class | Alternate { kNonIgnorable , kShifted } |
enum class | MaxVariable { kPunct , kSpace } |
Public Member Functions | |
Collation (std::string locale) | |
Creates a collation with mandatory locale. | |
Collation & | SetStrength (Strength strength) |
Sets the ICU collation level Default is kTertiary. | |
Collation & | SetCaseLevel (bool case_level) |
Sets whether to include case comparison at strength level 1 or 2 Default is false. | |
Collation & | SetCaseFirst (CaseFirst case_first) |
Sets sort order of case differences during tertiary level comparisons Default is kOff. | |
Collation & | SetNumericOrdering (bool numeric_ordering) |
Sets whether to compare numeric strings as numbers or as strings Default is false (compare as strings) | |
Collation & | SetAlternate (Alternate alternate) |
Sets whether collation should consider whitespace and punctuation as base characters Default is kNonIgnorable. | |
Collation & | SetMaxVariable (MaxVariable max_variable) |
Sets up to which characters are considered ignorable when alternate is kShifted Has no effect if alternate is kNonIgnorable. | |
Collation & | SetBackwards (bool backwards) |
Sets whether strings with diacritics sort from back of the string Default is false (compare from front to back) | |
Collation & | SetNormalization (bool normalization) |
Sets whether to check if text require normalization and perform normalization Default is false. | |
|
strong |
Enumerator | |
---|---|
kNonIgnorable | Whitespace and punctuation are considered base characters (default) |
kShifted | Whitespace and punctuation not considered base characters. |
Definition at line 341 of file options.hpp.
|
strong |
Enumerator | |
---|---|
kOff | Default value, similar to lower with slight differences. |
kUpper | Uppercase sorts before lowercase. |
kLower | Lowercase sorts before uppercase. |
Definition at line 332 of file options.hpp.
|
strong |
Enumerator | |
---|---|
kPunct | Both whitespace and punctuation are ignorable. |
kSpace | Only whitespace is ignorable. |
Definition at line 348 of file options.hpp.
|
strong |
Definition at line 319 of file options.hpp.