Method GetCollection
GetCollection<TDefaultDocument>(string)
Gets a MongoCollection instance representing a collection on this database with a default document type of TDefaultDocument.
public virtual MongoCollection<TDefaultDocument> GetCollection<TDefaultDocument>(string collectionName)
Parameters
collectionNamestringThe name of the collection.
Returns
- MongoCollection<TDefaultDocument>
An instance of MongoCollection.
Type Parameters
TDefaultDocumentThe default document type for this collection.
GetCollection<TDefaultDocument>(string, MongoCollectionSettings)
Gets a MongoCollection instance representing a collection on this database with a default document type of TDefaultDocument.
public virtual MongoCollection<TDefaultDocument> GetCollection<TDefaultDocument>(string collectionName, MongoCollectionSettings collectionSettings)
Parameters
collectionNamestringThe name of the collection.
collectionSettingsMongoCollectionSettingsThe settings to use when accessing this collection.
Returns
- MongoCollection<TDefaultDocument>
An instance of MongoCollection.
Type Parameters
TDefaultDocumentThe default document type for this collection.
GetCollection<TDefaultDocument>(string, WriteConcern)
Gets a MongoCollection instance representing a collection on this database with a default document type of TDefaultDocument.
public virtual MongoCollection<TDefaultDocument> GetCollection<TDefaultDocument>(string collectionName, WriteConcern writeConcern)
Parameters
collectionNamestringThe name of the collection.
writeConcernWriteConcernThe write concern to use when accessing this collection.
Returns
- MongoCollection<TDefaultDocument>
An instance of MongoCollection.
Type Parameters
TDefaultDocumentThe default document type for this collection.
GetCollection(string)
Gets a MongoCollection instance representing a collection on this database with a default document type of BsonDocument.
public virtual MongoCollection<BsonDocument> GetCollection(string collectionName)
Parameters
collectionNamestringThe name of the collection.
Returns
- MongoCollection<BsonDocument>
An instance of MongoCollection.
GetCollection(string, MongoCollectionSettings)
Gets a MongoCollection instance representing a collection on this database with a default document type of TDefaultDocument.
public virtual MongoCollection<BsonDocument> GetCollection(string collectionName, MongoCollectionSettings collectionSettings)
Parameters
collectionNamestringThe name of the collection.
collectionSettingsMongoCollectionSettingsThe settings to use when accessing this collection.
Returns
- MongoCollection<BsonDocument>
An instance of MongoCollection.
GetCollection(string, WriteConcern)
Gets a MongoCollection instance representing a collection on this database with a default document type of BsonDocument.
public virtual MongoCollection<BsonDocument> GetCollection(string collectionName, WriteConcern writeConcern)
Parameters
collectionNamestringThe name of the collection.
writeConcernWriteConcernThe write concern to use when accessing this collection.
Returns
- MongoCollection<BsonDocument>
An instance of MongoCollection.
GetCollection(Type, string)
Gets a MongoCollection instance representing a collection on this database with a default document type of BsonDocument.
public virtual MongoCollection GetCollection(Type defaultDocumentType, string collectionName)
Parameters
defaultDocumentTypeTypeThe default document type.
collectionNamestringThe name of the collection.
Returns
- MongoCollection
An instance of MongoCollection.
GetCollection(Type, string, MongoCollectionSettings)
Gets a MongoCollection instance representing a collection on this database with a default document type of BsonDocument.
public virtual MongoCollection GetCollection(Type defaultDocumentType, string collectionName, MongoCollectionSettings collectionSettings)
Parameters
defaultDocumentTypeTypeThe default document type.
collectionNamestringThe name of the collection.
collectionSettingsMongoCollectionSettingsThe settings to use when accessing this collection.
Returns
- MongoCollection
An instance of MongoCollection.
GetCollection(Type, string, WriteConcern)
Gets a MongoCollection instance representing a collection on this database with a default document type of BsonDocument.
public virtual MongoCollection GetCollection(Type defaultDocumentType, string collectionName, WriteConcern writeConcern)
Parameters
defaultDocumentTypeTypeThe default document type.
collectionNamestringThe name of the collection.
writeConcernWriteConcernThe write concern to use when accessing this collection.
Returns
- MongoCollection
An instance of MongoCollection.