Class Collation
Represents a MongoDB collation.
public sealed class Collation : IEquatable<Collation>, IConvertibleToBsonDocument
- Inheritance
-
Collation
- Implements
- Inherited Members
Constructors
Collation(string, Optional<bool?>, Optional<CollationCaseFirst?>, Optional<CollationStrength?>, Optional<bool?>, Optional<CollationAlternate?>, Optional<CollationMaxVariable?>, Optional<bool?>, Optional<bool?>)
Initializes a new instance of the Collation class.
public Collation(string locale, Optional<bool?> caseLevel = default, Optional<CollationCaseFirst?> caseFirst = default, Optional<CollationStrength?> strength = default, Optional<bool?> numericOrdering = default, Optional<CollationAlternate?> alternate = default, Optional<CollationMaxVariable?> maxVariable = default, Optional<bool?> normalization = default, Optional<bool?> backwards = default)
Parameters
localestringThe locale.
caseLevelOptional<bool?>The case level.
caseFirstOptional<CollationCaseFirst?>The case that is ordered first.
strengthOptional<CollationStrength?>The strength.
numericOrderingOptional<bool?>Whether numbers are ordered numerically.
alternateOptional<CollationAlternate?>The alternate.
maxVariableOptional<CollationMaxVariable?>The maximum variable.
normalizationOptional<bool?>The normalization.
backwardsOptional<bool?>Whether secondary differences are to be considered in reverse order.
Properties
Alternate
Gets whether spaces and punctuation are considered base characters.
public CollationAlternate? Alternate { get; }
Property Value
Backwards
Gets whether secondary differencs are to be considered in reverse order.
public bool? Backwards { get; }
Property Value
- bool?
CaseFirst
Gets whether upper case or lower case is ordered first.
public CollationCaseFirst? CaseFirst { get; }
Property Value
CaseLevel
Gets whether the collation is case sensitive at strength 1 and 2.
public bool? CaseLevel { get; }
Property Value
- bool?
Locale
Gets the locale.
public string Locale { get; }
Property Value
MaxVariable
Gets which characters are affected by the alternate: "Shifted".
public CollationMaxVariable? MaxVariable { get; }
Property Value
Normalization
Gets the normalization.
public bool? Normalization { get; }
Property Value
- bool?
NumericOrdering
Gets whether numbers are ordered numerically.
public bool? NumericOrdering { get; }
Property Value
- bool?
Simple
Gets the simple binary compare collation.
public static Collation Simple { get; }
Property Value
Strength
Gets the strength.
public CollationStrength? Strength { get; }
Property Value
Methods
Equals(Collation)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Collation other)
Parameters
otherCollationAn object to compare with this object.
Returns
- bool
true if the current object is equal to the
otherparameter; otherwise, false.
Equals(object)
public override bool Equals(object obj)
Parameters
objobject
Returns
FromBsonDocument(BsonDocument)
Creates a Collation instance from a BsonDocument.
public static Collation FromBsonDocument(BsonDocument document)
Parameters
documentBsonDocumentThe document.
Returns
- Collation
A Collation instance.
GetHashCode()
public override int GetHashCode()
Returns
ToBsonDocument()
Converts this object to a BsonDocument.
public BsonDocument ToBsonDocument()
Returns
- BsonDocument
A BsonDocument.
ToString()
public override string ToString()
Returns
With(Optional<string>, Optional<bool?>, Optional<CollationCaseFirst?>, Optional<CollationStrength?>, Optional<bool?>, Optional<CollationAlternate?>, Optional<CollationMaxVariable?>, Optional<bool?>, Optional<bool?>)
Creates a new Collation instance with some properties changed.
public Collation With(Optional<string> locale = default, Optional<bool?> caseLevel = default, Optional<CollationCaseFirst?> caseFirst = default, Optional<CollationStrength?> strength = default, Optional<bool?> numericOrdering = default, Optional<CollationAlternate?> alternate = default, Optional<CollationMaxVariable?> maxVariable = default, Optional<bool?> normalization = default, Optional<bool?> backwards = default)
Parameters
localeOptional<string>The new locale.
caseLevelOptional<bool?>The new case level.
caseFirstOptional<CollationCaseFirst?>The new case first.
strengthOptional<CollationStrength?>The new strength.
numericOrderingOptional<bool?>The new numeric ordering.
alternateOptional<CollationAlternate?>The new alternate.
maxVariableOptional<CollationMaxVariable?>The new maximum variable.
normalizationOptional<bool?>The new normalization.
backwardsOptional<bool?>The new backwards.
Returns
- Collation
A new Collation instance.