Table of Contents

Class MongoGridFSSettings

Namespace
MongoDB.Driver.GridFS
Assembly
MongoDB.Driver.Legacy.dll

Represents setting for GridFS.

[Serializable]
public class MongoGridFSSettings : IEquatable<MongoGridFSSettings>
Inheritance
MongoGridFSSettings
Implements
Inherited Members
Extension Methods

Constructors

MongoGridFSSettings()

Initializes a new instance of the MongoGridFSSettings class.

public MongoGridFSSettings()

MongoGridFSSettings(MongoDatabase)

Initializes a new instance of the MongoGridFSSettings class.

[Obsolete("Use new MongoGridFSSettings() instead.")]
public MongoGridFSSettings(MongoDatabase database)

Parameters

database MongoDatabase

The database from which to inherit some of the settings.

MongoGridFSSettings(int, string, WriteConcern)

Initializes a new instance of the MongoGridFSSettings class.

[Obsolete("Use new MongoGridFSSettings() instead.")]
public MongoGridFSSettings(int chunkSize, string root, WriteConcern writeConcern)

Parameters

chunkSize int

The chunk size.

root string

The root collection name.

writeConcern WriteConcern

The write concern.

Properties

ChunkSize

Gets or sets the chunk size.

public int ChunkSize { get; set; }

Property Value

int

ChunksCollectionName

Gets the chunks collection name.

[Obsolete("Use Root instead.")]
public string ChunksCollectionName { get; }

Property Value

string

Defaults

Gets or sets the default GridFS settings.

public static MongoGridFSSettings Defaults { get; set; }

Property Value

MongoGridFSSettings

FilesCollectionName

Gets the files collection name.

[Obsolete("Use Root instead.")]
public string FilesCollectionName { get; }

Property Value

string

GuidRepresentation

Gets or sets the GuidRepresentation.

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

Property Value

GuidRepresentation

IsFrozen

Gets a value indicating whether the settings are frozen.

public bool IsFrozen { get; }

Property Value

bool

ReadEncoding

Gets or sets the read encoding.

public UTF8Encoding ReadEncoding { get; set; }

Property Value

UTF8Encoding

ReadPreference

Gets or sets the ReadPreference.

public ReadPreference ReadPreference { get; set; }

Property Value

ReadPreference

Root

Gets or sets the root collection name (the files and chunks collection names are derived from the root).

public string Root { get; set; }

Property Value

string

UpdateMD5

Gets or sets a value indicating whether to udpate the MD5 hash on the server when a file is uploaded or modified.

public bool UpdateMD5 { get; set; }

Property Value

bool

VerifyMD5

Gets or sets a value indicating whether to verify the MD5 hash when a file is uploaded or downloaded.

public bool VerifyMD5 { get; set; }

Property Value

bool

WriteConcern

Gets or sets the WriteConcern.

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 MongoGridFSSettings Clone()

Returns

MongoGridFSSettings

A clone of the settings.

Equals(MongoGridFSSettings)

Compares this MongoGridFSSettings to another one.

public bool Equals(MongoGridFSSettings rhs)

Parameters

rhs MongoGridFSSettings

The other MongoGridFSSettings.

Returns

bool

True if the two settings are equal.

Equals(object)

Compares this MongoGridFSSettings to another object.

public override bool Equals(object obj)

Parameters

obj object

The other object.

Returns

bool

True if the other objects is a MongoGridFSSettings and is equal to this one.

Freeze()

Freezes the settings.

public MongoGridFSSettings Freeze()

Returns

MongoGridFSSettings

The frozen settings.

FrozenCopy()

Returns a frozen copy of the settings.

public MongoGridFSSettings FrozenCopy()

Returns

MongoGridFSSettings

A frozen copy of the settings.

GetHashCode()

Gets the hash code.

public override int GetHashCode()

Returns

int

The hash code.

Operators

operator ==(MongoGridFSSettings, MongoGridFSSettings)

Compares two MongoGridFSSettings.

public static bool operator ==(MongoGridFSSettings lhs, MongoGridFSSettings rhs)

Parameters

lhs MongoGridFSSettings

The first MongoGridFSSettings.

rhs MongoGridFSSettings

The other MongoGridFSSettings.

Returns

bool

True if the two MongoGridFSSettings are equal (or both null).

operator !=(MongoGridFSSettings, MongoGridFSSettings)

Compares two MongoGridFSSettings.

public static bool operator !=(MongoGridFSSettings lhs, MongoGridFSSettings rhs)

Parameters

lhs MongoGridFSSettings

The first MongoGridFSSettings.

rhs MongoGridFSSettings

The other MongoGridFSSettings.

Returns

bool

True if the two MongoGridFSSettings are not equal (or one is null and the other is not).