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
locale
stringThe locale.
caseLevel
Optional<bool?>The case level.
caseFirst
Optional<CollationCaseFirst?>The case that is ordered first.
strength
Optional<CollationStrength?>The strength.
numericOrdering
Optional<bool?>Whether numbers are ordered numerically.
alternate
Optional<CollationAlternate?>The alternate.
maxVariable
Optional<CollationMaxVariable?>The maximum variable.
normalization
Optional<bool?>The normalization.
backwards
Optional<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
other
CollationAn object to compare with this object.
Returns
- bool
true if the current object is equal to the
other
parameter; otherwise, false.
Equals(object)
public override bool Equals(object obj)
Parameters
obj
object
Returns
FromBsonDocument(BsonDocument)
Creates a Collation instance from a BsonDocument.
public static Collation FromBsonDocument(BsonDocument document)
Parameters
document
BsonDocumentThe 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
locale
Optional<string>The new locale.
caseLevel
Optional<bool?>The new case level.
caseFirst
Optional<CollationCaseFirst?>The new case first.
strength
Optional<CollationStrength?>The new strength.
numericOrdering
Optional<bool?>The new numeric ordering.
alternate
Optional<CollationAlternate?>The new alternate.
maxVariable
Optional<CollationMaxVariable?>The new maximum variable.
normalization
Optional<bool?>The new normalization.
backwards
Optional<bool?>The new backwards.
Returns
- Collation
A new Collation instance.