Table of Contents

Class CreateCollectionOptions

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Options for creating a collection.

public class CreateCollectionOptions
Inheritance
CreateCollectionOptions
Derived
Inherited Members

Properties

AutoIndexId

Gets or sets a value indicating whether to automatically create an index on the _id.

[Obsolete("AutoIndexId has been deprecated since server version 3.2.")]
public bool? AutoIndexId { get; set; }

Property Value

bool?

Capped

Gets or sets a value indicating whether the collection is capped.

public bool? Capped { get; set; }

Property Value

bool?

ChangeStreamPreAndPostImagesOptions

Gets or sets Gets or sets a change streams pre and post images options.

public ChangeStreamPreAndPostImagesOptions ChangeStreamPreAndPostImagesOptions { get; set; }

Property Value

ChangeStreamPreAndPostImagesOptions

Collation

Gets or sets the collation.

public Collation Collation { get; set; }

Property Value

Collation

EncryptedFields

Gets or sets encrypted fields.

public BsonDocument EncryptedFields { get; set; }

Property Value

BsonDocument

ExpireAfter

Gets or sets a timespan indicating how long documents in a time series collection should be retained.

public TimeSpan? ExpireAfter { get; set; }

Property Value

TimeSpan?

IndexOptionDefaults

Gets or sets the index option defaults.

public IndexOptionDefaults IndexOptionDefaults { get; set; }

Property Value

IndexOptionDefaults

The index option defaults.

MaxDocuments

Gets or sets the maximum number of documents (used with capped collections).

public long? MaxDocuments { get; set; }

Property Value

long?

MaxSize

Gets or sets the maximum size of the collection (used with capped collections).

public long? MaxSize { get; set; }

Property Value

long?

NoPadding

Gets or sets whether padding should not be used.

public bool? NoPadding { get; set; }

Property Value

bool?

SerializerRegistry

Gets or sets the serializer registry.

public IBsonSerializerRegistry SerializerRegistry { get; set; }

Property Value

IBsonSerializerRegistry

StorageEngine

Gets or sets the storage engine options.

public BsonDocument StorageEngine { get; set; }

Property Value

BsonDocument

TimeSeriesOptions

Gets or sets the TimeSeriesOptions to use when creating a time series collection.

public TimeSeriesOptions TimeSeriesOptions { get; set; }

Property Value

TimeSeriesOptions

UsePowerOf2Sizes

Gets or sets a value indicating whether to use power of 2 sizes.

public bool? UsePowerOf2Sizes { get; set; }

Property Value

bool?

ValidationAction

Gets or sets the validation action.

public DocumentValidationAction? ValidationAction { get; set; }

Property Value

DocumentValidationAction?

The validation action.

ValidationLevel

Gets or sets the validation level.

public DocumentValidationLevel? ValidationLevel { get; set; }

Property Value

DocumentValidationLevel?

The validation level.