Table of Contents

Class Collation

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.Core.dll

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 string

The 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

CollationAlternate?

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

CollationCaseFirst?

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

string

MaxVariable

Gets which characters are affected by the alternate: "Shifted".

public CollationMaxVariable? MaxVariable { get; }

Property Value

CollationMaxVariable?

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

Collation

Strength

Gets the strength.

public CollationStrength? Strength { get; }

Property Value

CollationStrength?

Methods

Equals(Collation)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(Collation other)

Parameters

other Collation

An 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

bool

FromBsonDocument(BsonDocument)

Creates a Collation instance from a BsonDocument.

public static Collation FromBsonDocument(BsonDocument document)

Parameters

document BsonDocument

The document.

Returns

Collation

A Collation instance.

GetHashCode()

public override int GetHashCode()

Returns

int

ToBsonDocument()

Converts this object to a BsonDocument.

public BsonDocument ToBsonDocument()

Returns

BsonDocument

A BsonDocument.

ToString()

public override string ToString()

Returns

string

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.