C# Class MongoDB.Driver.Builders.CollectionOptionsBuilder

Inheritance: BuilderBase, IMongoCollectionOptions
Show file Open project: CloudMetal/mongo-csharp-driver Class Usage Examples

Public Methods

Method Description
CollectionOptionsBuilder ( ) : System

Initializes a new instance of the CollectionOptionsBuilder class.

SetAutoIndexId ( bool value ) : CollectionOptionsBuilder

Sets whether to automatically create an index on the _id element.

SetCapped ( bool value ) : CollectionOptionsBuilder

Sets whether the collection is capped.

SetMaxDocuments ( long value ) : CollectionOptionsBuilder

Sets the max number of documents in a capped collection.

SetMaxSize ( long value ) : CollectionOptionsBuilder

Sets the max size of a capped collection.

ToBsonDocument ( ) : BsonDocument

Returns the result of the builder as a BsonDocument.

Protected Methods

Method Description
Serialize ( BsonWriter bsonWriter, Type nominalType, IBsonSerializationOptions options ) : void

Serializes the result of the builder to a BsonWriter.

Method Details

CollectionOptionsBuilder() public method

Initializes a new instance of the CollectionOptionsBuilder class.
public CollectionOptionsBuilder ( ) : System
return System

Serialize() protected method

Serializes the result of the builder to a BsonWriter.
protected Serialize ( BsonWriter bsonWriter, Type nominalType, IBsonSerializationOptions options ) : void
bsonWriter BsonWriter The writer.
nominalType System.Type The nominal type.
options IBsonSerializationOptions The serialization options.
return void

SetAutoIndexId() public method

Sets whether to automatically create an index on the _id element.
public SetAutoIndexId ( bool value ) : CollectionOptionsBuilder
value bool Whether to automatically create an index on the _id element.
return CollectionOptionsBuilder

SetCapped() public method

Sets whether the collection is capped.
public SetCapped ( bool value ) : CollectionOptionsBuilder
value bool Whether the collection is capped.
return CollectionOptionsBuilder

SetMaxDocuments() public method

Sets the max number of documents in a capped collection.
public SetMaxDocuments ( long value ) : CollectionOptionsBuilder
value long The max number of documents.
return CollectionOptionsBuilder

SetMaxSize() public method

Sets the max size of a capped collection.
public SetMaxSize ( long value ) : CollectionOptionsBuilder
value long The max size.
return CollectionOptionsBuilder

ToBsonDocument() public method

Returns the result of the builder as a BsonDocument.
public ToBsonDocument ( ) : BsonDocument
return BsonDocument