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
collectionName
stringThe name of the collection.
Returns
- MongoCollection<TDefaultDocument>
An instance of MongoCollection.
Type Parameters
TDefaultDocument
The 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
collectionName
stringThe name of the collection.
collectionSettings
MongoCollectionSettingsThe settings to use when accessing this collection.
Returns
- MongoCollection<TDefaultDocument>
An instance of MongoCollection.
Type Parameters
TDefaultDocument
The 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
collectionName
stringThe name of the collection.
writeConcern
WriteConcernThe write concern to use when accessing this collection.
Returns
- MongoCollection<TDefaultDocument>
An instance of MongoCollection.
Type Parameters
TDefaultDocument
The 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
collectionName
stringThe 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
collectionName
stringThe name of the collection.
collectionSettings
MongoCollectionSettingsThe 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
collectionName
stringThe name of the collection.
writeConcern
WriteConcernThe 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
defaultDocumentType
TypeThe default document type.
collectionName
stringThe 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
defaultDocumentType
TypeThe default document type.
collectionName
stringThe name of the collection.
collectionSettings
MongoCollectionSettingsThe 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
defaultDocumentType
TypeThe default document type.
collectionName
stringThe name of the collection.
writeConcern
WriteConcernThe write concern to use when accessing this collection.
Returns
- MongoCollection
An instance of MongoCollection.