Click or drag to resize

MongoCollectionTDefaultDocument Class

Represents a MongoDB collection and the settings used to access it as well as a default document type. This class is thread-safe.
Inheritance Hierarchy
SystemObject
  MongoDB.DriverMongoCollection
    MongoDB.DriverMongoCollectionTDefaultDocument

Namespace:  MongoDB.Driver
Assembly:  MongoDB.Driver.Legacy (in MongoDB.Driver.Legacy.dll) Version: 2.8.0+cc573f3e1f48f39162b4b680e921a623e127e8fa
Syntax
public class MongoCollection<TDefaultDocument> : MongoCollection

Type Parameters

TDefaultDocument
The default document type of the collection.

The MongoCollectionTDefaultDocument type exposes the following members.

Constructors
  NameDescription
Public methodMongoCollectionTDefaultDocument Obsolete.
Creates a new instance of MongoCollection. Normally you would call one of the indexers or GetCollection methods of MongoDatabase instead.
Top
Properties
  NameDescription
Public propertyDatabase
Gets the database that contains this collection.
(Inherited from MongoCollection.)
Public propertyFullName
Gets the fully qualified name of this collection.
(Inherited from MongoCollection.)
Public propertyName
Gets the name of this collection.
(Inherited from MongoCollection.)
Public propertySettings
Gets the settings being used to access this collection.
(Inherited from MongoCollection.)
Top
Methods
  NameDescription
Public methodAggregate
Represents an aggregate framework query. The command is not sent to the server until the result is enumerated.
(Inherited from MongoCollection.)
Public methodAggregateExplain
Runs an aggregate command with explain set and returns the explain result.
(Inherited from MongoCollection.)
Public methodCount
Counts the number of documents in this collection.
(Inherited from MongoCollection.)
Public methodCount(CountArgs)
Counts the number of documents in this collection that match a query.
(Inherited from MongoCollection.)
Public methodCount(IMongoQuery)
Counts the number of documents in this collection that match a query.
(Inherited from MongoCollection.)
Public methodCreateIndex(String)
Creates an index for this collection.
(Inherited from MongoCollection.)
Public methodCreateIndex(IMongoIndexKeys)
Creates an index for this collection.
(Inherited from MongoCollection.)
Public methodCreateIndex(IMongoIndexKeys, IMongoIndexOptions)
Creates an index for this collection.
(Inherited from MongoCollection.)
Public methodDistinct(String)
Returns the distinct values for a given field.
(Inherited from MongoCollection.)
Public methodDistinct(String, IMongoQuery)
Returns the distinct values for a given field for documents that match a query.
(Inherited from MongoCollection.)
Public methodDistinctTValue(DistinctArgs)
Returns the distinct values for a given field.
(Inherited from MongoCollection.)
Public methodDrop
Drops this collection.
(Inherited from MongoCollection.)
Public methodDropAllIndexes
Drops all indexes on this collection.
(Inherited from MongoCollection.)
Public methodDropIndex(String)
Drops an index on this collection.
(Inherited from MongoCollection.)
Public methodDropIndex(IMongoIndexKeys)
Drops an index on this collection.
(Inherited from MongoCollection.)
Public methodDropIndexByName
Drops an index on this collection.
(Inherited from MongoCollection.)
Public methodEnsureIndex(String) Obsolete.
Ensures that the desired index exists and creates it if it does not.
(Inherited from MongoCollection.)
Public methodEnsureIndex(IMongoIndexKeys) Obsolete.
Ensures that the desired index exists and creates it if it does not.
(Inherited from MongoCollection.)
Public methodEnsureIndex(IMongoIndexKeys, IMongoIndexOptions) Obsolete.
Ensures that the desired index exists and creates it if it does not.
(Inherited from MongoCollection.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExists
Tests whether this collection exists.
(Inherited from MongoCollection.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFind
Returns a cursor that can be used to find all documents in this collection that match the query as TDefaultDocuments.
Public methodFindAll
Returns a cursor that can be used to find all documents in this collection as TDefaultDocuments.
Public methodFindAllAs(Type)
Returns a cursor that can be used to find all documents in this collection as TDocuments.
(Inherited from MongoCollection.)
Public methodFindAllAsTDocument
Returns a cursor that can be used to find all documents in this collection as TDocuments.
(Inherited from MongoCollection.)
Public methodFindAndModify(FindAndModifyArgs)
Finds one matching document using the supplied arguments and applies the specified update to it.
(Inherited from MongoCollection.)
Public methodFindAndModify(IMongoQuery, IMongoSortBy, IMongoUpdate) Obsolete.
Finds one matching document using the query and sortBy parameters and applies the specified update to it.
(Inherited from MongoCollection.)
Public methodFindAndModify(IMongoQuery, IMongoSortBy, IMongoUpdate, Boolean) Obsolete.
Finds one matching document using the query and sortBy parameters and applies the specified update to it.
(Inherited from MongoCollection.)
Public methodFindAndModify(IMongoQuery, IMongoSortBy, IMongoUpdate, Boolean, Boolean) Obsolete.
Finds one matching document using the query and sortBy parameters and applies the specified update to it.
(Inherited from MongoCollection.)
Public methodFindAndModify(IMongoQuery, IMongoSortBy, IMongoUpdate, IMongoFields, Boolean, Boolean) Obsolete.
Finds one matching document using the query and sortBy parameters and applies the specified update to it.
(Inherited from MongoCollection.)
Public methodFindAndRemove(FindAndRemoveArgs)
Finds one matching document using the supplied args and removes it from this collection.
(Inherited from MongoCollection.)
Public methodFindAndRemove(IMongoQuery, IMongoSortBy) Obsolete.
Finds one matching document using the query and sortBy parameters and removes it from this collection.
(Inherited from MongoCollection.)
Public methodFindAs(Type, IMongoQuery)
Returns a cursor that can be used to find all documents in this collection that match the query as TDocuments.
(Inherited from MongoCollection.)
Public methodFindAsTDocument(IMongoQuery)
Returns a cursor that can be used to find all documents in this collection that match the query as TDocuments.
(Inherited from MongoCollection.)
Public methodFindOne
Returns one document in this collection as a TDefaultDocument.
Public methodFindOne(IMongoQuery)
Returns one document in this collection that matches a query as a TDefaultDocument.
Public methodFindOneAs(Type)
Returns one document in this collection as a TDocument.
(Inherited from MongoCollection.)
Public methodFindOneAs(Type, FindOneArgs)
Returns one document in this collection as a TDocument.
(Inherited from MongoCollection.)
Public methodFindOneAs(Type, IMongoQuery)
Returns one document in this collection that matches a query as a TDocument.
(Inherited from MongoCollection.)
Public methodFindOneAsTDocument
Returns one document in this collection as a TDocument.
(Inherited from MongoCollection.)
Public methodFindOneAsTDocument(FindOneArgs)
Returns one document in this collection as a TDocument.
(Inherited from MongoCollection.)
Public methodFindOneAsTDocument(IMongoQuery)
Returns one document in this collection that matches a query as a TDocument.
(Inherited from MongoCollection.)
Public methodFindOneById
Returns a cursor that can be used to find one document in this collection by its _id value as a TDefaultDocument.
Public methodFindOneByIdAs(Type, BsonValue)
Returns a cursor that can be used to find one document in this collection by its _id value as a TDocument.
(Inherited from MongoCollection.)
Public methodFindOneByIdAsTDocument(BsonValue)
Returns a cursor that can be used to find one document in this collection by its _id value as a TDocument.
(Inherited from MongoCollection.)
Public methodGeoHaystackSearch(GeoHaystackSearchArgs)
Runs a geoHaystack search command on this collection.
Public methodGeoHaystackSearch(Double, Double, IMongoGeoHaystackSearchOptions) Obsolete.
Runs a geoHaystack search command on this collection.
Public methodGeoHaystackSearchAs(Type, GeoHaystackSearchArgs)
Runs a geoHaystack search command on this collection.
(Inherited from MongoCollection.)
Public methodGeoHaystackSearchAs(Type, Double, Double, IMongoGeoHaystackSearchOptions) Obsolete.
Runs a geoHaystack search command on this collection.
(Inherited from MongoCollection.)
Public methodGeoHaystackSearchAsTDocument(GeoHaystackSearchArgs)
Runs a geoHaystack search command on this collection.
(Inherited from MongoCollection.)
Public methodGeoHaystackSearchAsTDocument(Double, Double, IMongoGeoHaystackSearchOptions) Obsolete.
Runs a geoHaystack search command on this collection.
(Inherited from MongoCollection.)
Public methodGeoNear(GeoNearArgs)
Runs a GeoNear command on this collection.
Public methodGeoNear(IMongoQuery, Double, Double, Int32) Obsolete.
Runs a GeoNear command on this collection.
Public methodGeoNear(IMongoQuery, Double, Double, Int32, IMongoGeoNearOptions) Obsolete.
Runs a GeoNear command on this collection.
Public methodGeoNearAs(Type, GeoNearArgs)
Runs a GeoNear command on this collection.
(Inherited from MongoCollection.)
Public methodGeoNearAs(Type, IMongoQuery, Double, Double, Int32) Obsolete.
Runs a GeoNear command on this collection.
(Inherited from MongoCollection.)
Public methodGeoNearAs(Type, IMongoQuery, Double, Double, Int32, IMongoGeoNearOptions) Obsolete.
Runs a GeoNear command on this collection.
(Inherited from MongoCollection.)
Public methodGeoNearAsTDocument(GeoNearArgs)
Runs a GeoNear command on this collection.
(Inherited from MongoCollection.)
Public methodGeoNearAsTDocument(IMongoQuery, Double, Double, Int32) Obsolete.
Runs a GeoNear command on this collection.
(Inherited from MongoCollection.)
Public methodGeoNearAsTDocument(IMongoQuery, Double, Double, Int32, IMongoGeoNearOptions) Obsolete.
Runs a GeoNear command on this collection.
(Inherited from MongoCollection.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetIndexes
Gets the indexes for this collection.
(Inherited from MongoCollection.)
Public methodGetStats
Gets the stats for this collection.
(Inherited from MongoCollection.)
Public methodGetStats(GetStatsArgs)
Gets the stats for this collection.
(Inherited from MongoCollection.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGroup(GroupArgs)
Runs the group command on this collection.
(Inherited from MongoCollection.)
Public methodGroup(IMongoQuery, BsonJavaScript, BsonDocument, BsonJavaScript, BsonJavaScript)
Runs the group command on this collection.
(Inherited from MongoCollection.)
Public methodGroup(IMongoQuery, IMongoGroupBy, BsonDocument, BsonJavaScript, BsonJavaScript)
Runs the group command on this collection.
(Inherited from MongoCollection.)
Public methodGroup(IMongoQuery, String, BsonDocument, BsonJavaScript, BsonJavaScript)
Runs the group command on this collection.
(Inherited from MongoCollection.)
Public methodIndexExists(String)
Tests whether an index exists.
(Inherited from MongoCollection.)
Public methodIndexExists(IMongoIndexKeys)
Tests whether an index exists.
(Inherited from MongoCollection.)
Public methodIndexExistsByName
Tests whether an index exists.
(Inherited from MongoCollection.)
Public methodInitializeOrderedBulkOperation
Creates a fluent builder for an ordered bulk operation.
Public methodInitializeOrderedBulkOperationAsTDocument
Creates a fluent builder for an ordered bulk operation.
(Inherited from MongoCollection.)
Public methodInitializeUnorderedBulkOperation
Creates a fluent builder for an unordered bulk operation.
Public methodInitializeUnorderedBulkOperationAsTDocument
Creates a fluent builder for an unordered bulk operation.
(Inherited from MongoCollection.)
Public methodInsert(TDefaultDocument)
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
Public methodInsert(Type, Object)
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
(Inherited from MongoCollection.)
Public methodInsert(TDefaultDocument, MongoInsertOptions)
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
Public methodInsert(TDefaultDocument, WriteConcern)
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
Public methodInsert(Type, Object, MongoInsertOptions)
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
(Inherited from MongoCollection.)
Public methodInsert(Type, Object, WriteConcern)
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
(Inherited from MongoCollection.)
Public methodInsertTNominalType(TNominalType)
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
(Inherited from MongoCollection.)
Public methodInsertTNominalType(TNominalType, MongoInsertOptions)
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
(Inherited from MongoCollection.)
Public methodInsertTNominalType(TNominalType, WriteConcern)
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
(Inherited from MongoCollection.)
Public methodInsertBatch(IEnumerableTDefaultDocument)
Inserts multiple documents at once into this collection (see also Insert to insert a single document).
Public methodInsertBatch(Type, IEnumerable)
Inserts multiple documents at once into this collection (see also Insert to insert a single document).
(Inherited from MongoCollection.)
Public methodInsertBatch(IEnumerableTDefaultDocument, MongoInsertOptions)
Inserts multiple documents at once into this collection (see also Insert to insert a single document).
Public methodInsertBatch(IEnumerableTDefaultDocument, WriteConcern)
Inserts multiple documents at once into this collection (see also Insert to insert a single document).
Public methodInsertBatch(Type, IEnumerable, MongoInsertOptions)
Inserts multiple documents at once into this collection (see also Insert to insert a single document).
(Inherited from MongoCollection.)
Public methodInsertBatch(Type, IEnumerable, WriteConcern)
Inserts multiple documents at once into this collection (see also Insert to insert a single document).
(Inherited from MongoCollection.)
Public methodInsertBatchTNominalType(IEnumerableTNominalType)
Inserts multiple documents at once into this collection (see also Insert to insert a single document).
(Inherited from MongoCollection.)
Public methodInsertBatchTNominalType(IEnumerableTNominalType, MongoInsertOptions)
Inserts multiple documents at once into this collection (see also Insert to insert a single document).
(Inherited from MongoCollection.)
Public methodInsertBatchTNominalType(IEnumerableTNominalType, WriteConcern)
Inserts multiple documents at once into this collection (see also Insert to insert a single document).
(Inherited from MongoCollection.)
Public methodIsCapped
Tests whether this collection is capped.
(Inherited from MongoCollection.)
Public methodMapReduce
Runs a map-reduce command on this collection.
(Inherited from MongoCollection.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodParallelScan
Scans an entire collection in parallel using multiple cursors.
Public methodParallelScanAs(Type, ParallelScanArgs)
Scans an entire collection in parallel using multiple cursors.
(Inherited from MongoCollection.)
Public methodParallelScanAsTDocument(ParallelScanArgsTDocument)
Scans an entire collection in parallel using multiple cursors.
(Inherited from MongoCollection.)
Public methodReIndex
Runs the ReIndex command on this collection.
(Inherited from MongoCollection.)
Public methodRemove(IMongoQuery)
Removes documents from this collection that match a query.
(Inherited from MongoCollection.)
Public methodRemove(RemoveArgs)
Removes documents from this collection that match a query.
(Inherited from MongoCollection.)
Public methodRemove(IMongoQuery, RemoveFlags)
Removes documents from this collection that match a query.
(Inherited from MongoCollection.)
Public methodRemove(IMongoQuery, WriteConcern)
Removes documents from this collection that match a query.
(Inherited from MongoCollection.)
Public methodRemove(IMongoQuery, RemoveFlags, WriteConcern)
Removes documents from this collection that match a query.
(Inherited from MongoCollection.)
Public methodRemoveAll
Removes all documents from this collection (see also Drop).
(Inherited from MongoCollection.)
Public methodRemoveAll(WriteConcern)
Removes all documents from this collection (see also Drop).
(Inherited from MongoCollection.)
Public methodSave(TDefaultDocument)
Saves a document to this collection. The document must have an identifiable Id field. Based on the value of the Id field Save will perform either an Insert or an Update.
Public methodSave(Type, Object)
Saves a document to this collection. The document must have an identifiable Id field. Based on the value of the Id field Save will perform either an Insert or an Update.
(Inherited from MongoCollection.)
Public methodSave(TDefaultDocument, MongoInsertOptions)
Saves a document to this collection. The document must have an identifiable Id field. Based on the value of the Id field Save will perform either an Insert or an Update.
Public methodSave(TDefaultDocument, WriteConcern)
Saves a document to this collection. The document must have an identifiable Id field. Based on the value of the Id field Save will perform either an Insert or an Update.
Public methodSave(Type, Object, MongoInsertOptions)
Saves a document to this collection. The document must have an identifiable Id field. Based on the value of the Id field Save will perform either an Insert or an Update.
(Inherited from MongoCollection.)
Public methodSave(Type, Object, WriteConcern)
Saves a document to this collection. The document must have an identifiable Id field. Based on the value of the Id field Save will perform either an Insert or an Update.
(Inherited from MongoCollection.)
Public methodSaveTNominalType(TNominalType)
Saves a document to this collection. The document must have an identifiable Id field. Based on the value of the Id field Save will perform either an Insert or an Update.
(Inherited from MongoCollection.)
Public methodSaveTNominalType(TNominalType, MongoInsertOptions)
Saves a document to this collection. The document must have an identifiable Id field. Based on the value of the Id field Save will perform either an Insert or an Update.
(Inherited from MongoCollection.)
Public methodSaveTNominalType(TNominalType, WriteConcern)
Saves a document to this collection. The document must have an identifiable Id field. Based on the value of the Id field Save will perform either an Insert or an Update.
(Inherited from MongoCollection.)
Public methodToString
Gets a canonical string representation for this database.
(Inherited from MongoCollection.)
Public methodUpdate(IMongoQuery, IMongoUpdate)
Updates one matching document in this collection.
(Inherited from MongoCollection.)
Public methodUpdate(IMongoQuery, IMongoUpdate, MongoUpdateOptions)
Updates one or more matching documents in this collection (for multiple updates use UpdateFlags.Multi).
(Inherited from MongoCollection.)
Public methodUpdate(IMongoQuery, IMongoUpdate, UpdateFlags)
Updates one or more matching documents in this collection (for multiple updates use UpdateFlags.Multi).
(Inherited from MongoCollection.)
Public methodUpdate(IMongoQuery, IMongoUpdate, WriteConcern)
Updates one matching document in this collection.
(Inherited from MongoCollection.)
Public methodUpdate(IMongoQuery, IMongoUpdate, UpdateFlags, WriteConcern)
Updates one or more matching documents in this collection (for multiple updates use UpdateFlags.Multi).
(Inherited from MongoCollection.)
Public methodValidate
Validates the integrity of this collection.
(Inherited from MongoCollection.)
Public methodValidate(ValidateCollectionArgs)
Validates the integrity of this collection.
(Inherited from MongoCollection.)
Public methodWithReadConcern
Returns a new MongoCollection instance with a different read concern setting.
Public methodWithReadPreference
Returns a new MongoCollection instance with a different read preference setting.
Public methodWithWriteConcern
Returns a new MongoCollection instance with a different write concern setting.
Top
Extension Methods
See Also