Table of Contents

Class MongoDatabaseSettings

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

The settings used to access a database.

public class MongoDatabaseSettings
Inheritance
MongoDatabaseSettings
Inherited Members

Constructors

MongoDatabaseSettings()

Creates a new instance of MongoDatabaseSettings.

public MongoDatabaseSettings()

Properties

GuidRepresentation

Gets or sets the representation to use for Guids.

[Obsolete("Configure serializers instead.")]
public GuidRepresentation GuidRepresentation { get; set; }

Property Value

GuidRepresentation

IsFrozen

Gets a value indicating whether the settings have been frozen to prevent further changes.

public bool IsFrozen { get; }

Property Value

bool

ReadConcern

Gets or sets the read concern.

public ReadConcern ReadConcern { get; set; }

Property Value

ReadConcern

ReadEncoding

Gets or sets the Read Encoding.

public UTF8Encoding ReadEncoding { get; set; }

Property Value

UTF8Encoding

ReadPreference

Gets or sets the read preference.

public ReadPreference ReadPreference { get; set; }

Property Value

ReadPreference

SerializerRegistry

Gets the serializer registry.

public IBsonSerializerRegistry SerializerRegistry { get; }

Property Value

IBsonSerializerRegistry

WriteConcern

Gets or sets the WriteConcern to use.

public WriteConcern WriteConcern { get; set; }

Property Value

WriteConcern

WriteEncoding

Gets or sets the Write Encoding.

public UTF8Encoding WriteEncoding { get; set; }

Property Value

UTF8Encoding

Methods

Clone()

Creates a clone of the settings.

public MongoDatabaseSettings Clone()

Returns

MongoDatabaseSettings

A clone of the settings.

Equals(object)

Compares two MongoDatabaseSettings instances.

public override bool Equals(object obj)

Parameters

obj object

The other instance.

Returns

bool

True if the two instances are equal.

Freeze()

Freezes the settings.

public MongoDatabaseSettings Freeze()

Returns

MongoDatabaseSettings

The frozen settings.

FrozenCopy()

Returns a frozen copy of the settings.

public MongoDatabaseSettings FrozenCopy()

Returns

MongoDatabaseSettings

A frozen copy of the settings.

GetHashCode()

Gets the hash code.

public override int GetHashCode()

Returns

int

The hash code.

ToString()

Returns a string representation of the settings.

public override string ToString()

Returns

string

A string representation of the settings.