summaryrefslogtreecommitdiff
path: root/src/mongo/idl
diff options
context:
space:
mode:
authorA. Jesse Jiryu Davis <jesse@mongodb.com>2021-02-03 09:36:11 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-02-05 04:53:57 +0000
commit1736293848e2a251db316bb5b4f529739d5e5a27 (patch)
tree2a26994902f5cb0fc00f91a5836b2f0a6ee4ef7d /src/mongo/idl
parentc30378eaeb628b741b152b69caa4e89d3b9aefaf (diff)
downloadmongo-1736293848e2a251db316bb5b4f529739d5e5a27.tar.gz
SERVER-52538 Merge Collation and CollationSpec classes
Diffstat (limited to 'src/mongo/idl')
-rw-r--r--src/mongo/idl/basic_types.idl46
1 files changed, 34 insertions, 12 deletions
diff --git a/src/mongo/idl/basic_types.idl b/src/mongo/idl/basic_types.idl
index edd724d10c8..c82abccf4f7 100644
--- a/src/mongo/idl/basic_types.idl
+++ b/src/mongo/idl/basic_types.idl
@@ -263,19 +263,29 @@ enums:
kLower: lower
kOff: off
+ CollationStrength:
+ description: Controls the set of characteristics used to compare strings.
+ type: int
+ values:
+ kPrimary: 1
+ kSecondary: 2
+ kTertiary: 3
+ kQuaternary: 4
+ kIdentical: 5
+
CollationAlternate:
description: Whether collation should consider whitespace and punctuation as base characters for purposes of comparison.
type: string
values:
- kAlternateNonIgnorable: non-ignorable
- kAlternateShifted: shifted
+ kNonIgnorable: non-ignorable
+ kShifted: shifted
CollationMaxVariable:
description: Up to which characters are considered ignorable when alternate is "shifted".
type: string
values:
- kMaxVariablePunct: punct
- kMaxVariableSpace: space
+ kPunct: punct
+ kSpace: space
structs:
OkReply:
@@ -344,31 +354,43 @@ structs:
fields:
locale:
type: string
+ # Turns case sensitivity on at strength 1 or 2.
caseLevel:
type: bool
- optional: true
+ default: false
caseFirst:
type: CollationCaseFirst
- optional: true
+ default: kOff
+ # For backwards-compatibility, we must accept longs, ints, and doubles, so we cannot
+ # use the int-typed CollationStrength enum directly.
strength:
- type: exactInt64
- optional: true
+ type: safeInt
+ default: static_cast<int>(CollationStrength::kTertiary)
validator: { gte: 0, lte: 5 }
+ # Order numbers based on numerical order and not lexicographic order.
numericOrdering:
type: bool
- optional: true
+ default: false
alternate:
type: CollationAlternate
- optional: true
+ default: kNonIgnorable
maxVariable:
type: CollationMaxVariable
- optional: true
+ default: kPunct
+ # Any language that uses multiple combining characters such as Arabic, ancient Greek,
+ # Hebrew, Hindi, Thai or Vietnamese either requires Normalization Checking to be on, or
+ # the text to go through a normalization process before collation.
normalization:
type: bool
- optional: true
+ default: false
+ # Causes accent differences to be considered in reverse order, as it is done in the
+ # French language.
backwards:
type: bool
optional: true
+ # Indicates the version of the collator. It is used to ensure that we do not mix
+ # versions by, for example, constructing an index with one version of ICU and then
+ # attempting to use this index with a server that is built against a newer ICU version.
version:
type: string
optional: true