MongoDB.Driver NamespaceMongoDB C# Driver API Documentation
The MongoDB.Driver namespace contains all the basic types and classes that compose the MongoDB driver. It contains the classes needed for most interactions with the database.
Classes

  ClassDescription
Public classAggregateArgs
Represents options for the Aggregate command.
Public classAggregateResult
Represents the results of a Aggregate command.
Public classBulkUpdateRequestBuilder
Represents a fluent builder for one update request.
Public classBulkWriteError
Represents the details of a write error for a particular request.
Public classBulkWriteException Obsolete.
Represents a bulk write exception.
Public classBulkWriteOperation
Represents a fluent builder for a bulk operation.
Public classBulkWriteRequestBuilder
Represents a fluent builder for a write request (either a remove or an update).
Public classBulkWriteResult
Represents the result of a bulk write operation.
Public classBulkWriteUpsert
Represents the information about one Upsert.
Public classCanCommandBeSentToSecondary
Represents a container for the CanCommandBeSentToSecondary delegate.
Public classCollectionOptionsDocument
Represents a BSON document that can be used where an IMongoCollectionOptions is expected.
Public classCollectionStatsResult
Represents the results of the collection stats command.
Public classCollectionStatsResultIndexSizesResult
Represents a collection of index sizes.
Public classCommandDocument
Represents a BSON document that can be used where an IMongoCommand is expected.
Public classCommandResult
Represents the result of a command (there are also subclasses for various commands).
Public classCommandResultSerializer
Represents a serializer for a CommandResult.
Public classCountArgs
Represents arguments for the Count command helper method.
Public classDatabaseStatsResult
Represents the result of the database stats command.
Public classDeleteRequest
Represents a request to delete one or more documents.
Public classDistinctArgs
Represents arguments for the Distinct command helper method.
Public classDistinctCommandResultTValue
Represents the result of a command (there are also subclasses for various commands).
Public classDistinctCommandResultSerializerTValue
Represents a serializer for a DistinctCommandResult with values of type TValue.
Public classEvalArgs
Represents arguments for the Eval command helper method.
Public classExceptionMapper
A mapper from error responses to custom exceptions.
Public classExecutionTimeoutException Obsolete.
Represents a MongoDB execution timeout exception.
Public classExternalEvidence
Evidence of a MongoIdentity via an external mechanism. For example, on windows this may be the current process' user or, on linux, via kinit.
Public classFieldsDocument
Represents a BSON document that can be used where an IMongoFields is expected.
Public classFindAndModifyArgs
Represents options for the FindAndModify command.
Public classFindAndModifyResult
Represents the result of a FindAndModify command.
Public classFindAndRemoveArgs
Represents options for the FindAndRemove command.
Public classFindOneArgs
Represents arguments to the FindOne method.
Public classGeoHaystackSearchArgs
Represents the arguments to the GeoHaystackSearch method.
Public classGeoHaystackSearchOptionsDocument Obsolete.
Represents a BSON document that can be used where an IMongoGeoHaystackSearchOptions is expected.
Public classGeoHaystackSearchResult
Represents the result of a GeoHaystackSearch command.
Public classGeoHaystackSearchResultGeoHaystackSearchHit
Represents a GeoHaystackSearch hit.
Public classGeoHaystackSearchResultGeoHaystackSearchHits
Represents a collection of GeoHaystackSearch hits.
Public classGeoHaystackSearchResultGeoHaystackSearchStats
Represents the stats of a GeoHaystackSearch command.
Public classGeoHaystackSearchResultTDocument
Represents the result of a GeoHaystackSearch command.
Public classGeoHaystackSearchResultTDocumentGeoHaystackSearchHit
Represents a GeoHaystackSearch hit.
Public classGeoHaystackSearchResultTDocumentGeoHaystackSearchHits
Represents a collection of GeoHaystackSearch hits.
Public classGeoNearArgs
Represents the arguments to the GeoNear method.
Public classGeoNearOptionsDocument Obsolete.
Represents a BSON document that can be used where an IMongoGeoNearOptions is expected.
Public classGeoNearPoint
Represents a GeoNearPoint (wraps either an XYPoint or a GeoJsonPoint).
Public classGeoNearPointGeoJsonTCoordinates
Represents a GeoNearPoint that wraps a GeoJsonPoint.
Public classGeoNearPointLegacy
Represents a GeoNearPoint that wraps an XYPoint.
Public classGeoNearResult
Represents the result of a GeoNear command.
Public classGeoNearResultGeoNearHit
Represents a GeoNear hit.
Public classGeoNearResultGeoNearHits
Represents a collection of GeoNear hits.
Public classGeoNearResultGeoNearStats
Represents the stats of a GeoNear command.
Public classGeoNearResultTDocument
Represents the result of a GeoNear command.
Public classGeoNearResultTDocumentGeoNearHit
Represents a GeoNear hit.
Public classGeoNearResultTDocumentGeoNearHits
Represents a collection of GeoNear hits.
Public classGetIndexesResult
Represents the result of GetIndexes.
Public classGetLastErrorResult Obsolete.
Represents the results of a GetLastError command.
Public classGetProfilingLevelResult
Represents the results of a GetProfilingLevel command.
Public classGetStatsArgs
Represents arguments for the GetStats command helper method.
Public classGroupArgs
Represents arguments for the Group command helper method.
Public classGroupByDocument
Represents a BSON document that can be used where an IMongoGroupBy is expected.
Public classIndexInfo
Represents information about an index.
Public classIndexKeysDocument
Represents a BSON document that can be used where an IMongoIndexKeys is expected.
Public classIndexOptionDefaults
Represents index option defaults.
Public classIndexOptionsDocument
Represents a BSON document that can be used where an IMongoIndexOptions is expected.
Public classInsertRequest
Represents a request to insert a document.
Public classIsMasterResult
Represents the result of an isMaster command.
Public classMapReduceArgs
Represents arguments for the MapReduce command helper method.
Public classMapReduceOptionsDocument Obsolete.
Represents a BSON document that can be used where an IMongoMapReduceOptions is expected.
Public classMapReduceResult
Represents the result of a map/reduce command.
Public classMongoAuthenticationException
Represents a MongoDB authentication exception
Public classMongoBulkWriteException
Represents a bulk write exception.
Public classMongoClient
Represents a client to MongoDB.
Public classMongoClientSettings
The settings for a MongoDB client.
Public classMongoCollection
Represents a MongoDB collection and the settings used to access it. This class is thread-safe.
Public classMongoCollectionTDefaultDocument
Represents a MongoDB collection and the settings used to access it as well as a default document type. This class is thread-safe.
Public classMongoCollectionSettings
The settings used to access a collection.
Public classMongoCollectionSettingsTDefaultDocument Obsolete.
Settings used to access a collection (this class is obsolete, use the non-generic MongoCollectionSettings class instead).
Public classMongoCommandException
Represents a MongoDB command exception.
Public classMongoConnectionException
Represents a MongoDB connection exception.
Public classMongoConnectionStringBuilder
Represents .NET style connection strings. We recommend you use URL style connection strings (see MongoUrl and MongoUrlBuilder).
Public classMongoCredential
Credential to access a MongoDB database.
Public classMongoCursor
An object that can be enumerated to fetch the results of a query. The query is not sent to the server until you begin enumerating the results.
Public classMongoCursorTDocument
An object that can be enumerated to fetch the results of a query. The query is not sent to the server until you begin enumerating the results.
Public classMongoCursorEnumeratorTDocument
Reprsents an enumerator that fetches the results of a query sent to the server.
Public classMongoDatabase
Represents a MongoDB database and the settings used to access it. This class is thread-safe.
Public classMongoDatabaseSettings
The settings used to access a database.
Public classMongoDBRef
Represents a DBRef (a convenient way to refer to a document).
Public classMongoDBRefSerializer
Represents a serializer for MongoDBRefs.
Public classMongoDefaults
Default values for various Mongo settings.
Public classMongoDuplicateKeyException
Thrown when a duplicate key is inserted into a collection.
Public classMongoException
Represents a MongoDB exception.
Public classMongoExecutionTimeoutException
Represents a MongoDB execution timeout exception.
Public classMongoExternalIdentity
Represents an identity defined outside of mongodb.
Public classMongoIdentity
Represents an identity in MongoDB.
Public classMongoIdentityEvidence
Evidence used as proof of a MongoIdentity.
Public classMongoInsertOptions
Represents the options to use for an Insert or InsertBatch operation.
Public classMongoInternalException
Represents a MongoDB internal exception (almost surely the result of a bug).
Public classMongoInternalIdentity
Represents an identity defined inside mongodb.
Public classMongoQueryException
Represents a MongoDB query exception.
Public classMongoSafeModeException Obsolete.
Represents a MongoDB safe mode exception.
Public classMongoServer
Represents a MongoDB server (either a single instance or a replica set) and the settings used to access it. This class is thread-safe.
Public classMongoServerAddress
The address of a MongoDB server.
Public classMongoServerBuildInfo
Represents build info about a server instance.
Public classMongoServerInstance
Represents an instance of a MongoDB server host.
Public classMongoServerSettings
The settings used to access a MongoDB server.
Public classMongoUpdateOptions
Represents the options to use for an Update operation.
Public classMongoUrl
Represents an immutable URL style connection string. See also MongoUrlBuilder.
Public classMongoUrlBuilder
Represents URL style connection strings. This is the recommended connection string style, but see also MongoConnectionStringBuilder if you wish to use .NET style connection strings.
Public classMongoUser Obsolete.
Represents a MongoDB user.
Public classMongoUtils
Various static utility methods.
Public classMongoWriteConcernException
Represents a write concern exception.
Public classParallelScanArgs
Represents arguments for the ParallelScan command helper method.
Public classPasswordEvidence
Evidence of a MongoIdentity via a shared secret.
Public classQueryDocument
Represents a BSON document that can be used where an IMongoQuery is expected.
Public classReadPreference
Represents read preferences.
Public classReplicaSetTag
Represents a replica set tag.
Public classReplicaSetTagSet
Represents a set of replica set tags.
Public classSafeMode Obsolete.
Represents the different safe modes that can be used.
Public classSafeModeResult Obsolete.
Represents the results of an operation performed with WriteConcern enabled.
Public classScopeDocument
Represents a BSON document that can be used where an IMongoScope is expected.
Public classServerInstanceConnectionProvider
Represents a provider of connections to a specific server instance.
Public classSortByDocument
Represents a BSON document that can be used where an IMongoSortBy is expected.
Public classSslSettings
Represents the settings for using SSL.
Public classSystemProfileInfo
Represents a document from the system.profile collection.
Public classSystemProfileInfoSerializer
Represents a serializer for SystemProfileInfo.
Public classSystemProfileLockStatistics
Statistics about locks for a system.profile document.
Public classSystemProfileLockStatisticsSerializer
Serializer for SystemProfileLockStatistics
Public classSystemProfileReadWriteLockStatistics
Statistics about system.profile read and write time spent in locks.
Public classSystemProfileReadWriteLockStatisticsSerializer
Serializer for SystemProfileReadWriteLockStatistics
Public classTextSearchOptions
Represents text search options.
Public classUpdateDocument
Represents a BSON document that can be used where an IMongoUpdate is expected.
Public classUpdateRequest
Represents a request to update one or more documents.
Public classValidateCollectionArgs
Represents arguments for the Validate collection command helper method.
Public classValidateCollectionResult
Represents the results of a validate collection command.
Public classValidateCollectionResultExtentDetails
Represents the details of the first extent of the collection.
Public classWriteConcern
Represents the different WriteConcerns that can be used.
Public classWriteConcernWCount
Represents an integer "w" value in a WriteConcern.
Public classWriteConcernWMode
Represents a string "w" value in a WriteConcern (the name of a mode).
Public classWriteConcernWValue
Represents a "w" value in a WriteConcern.
Public classWriteConcernError
Represents the details of a write concern error.
Public classWriteConcernException Obsolete.
Represents a write concern exception.
Public classWriteConcernResult
Represents the results of an operation performed with WriteConcern enabled.
Public classWriteRequest
Represents a request to write something to the database.
Public classXYPoint
Represents a 2D point represented using x, y coordinates.
Structures

  StructureDescription
Public structureSettingT
Represents a setting that may or may not have been set.
Interfaces

  InterfaceDescription
Public interfaceIMongoCollectionOptions
A marker interface that represents options for creating a collection (see CollectionOptionsDocument and the CollectionOptions builder).
Public interfaceIMongoCommand
A marker interface that represents a command (see CommandDocument).
Public interfaceIMongoFields
A marker interface that represents a list of fields (see FieldsDocument and the Fields builder).
Public interfaceIMongoGeoHaystackSearchOptions Obsolete.
A marker interface that represents geo haystack search options (see GeoSearchHaystackOptionsDocument and the GeoHaystackSearchOptions builder).
Public interfaceIMongoGeoNearOptions Obsolete.
A marker interface that represents geo search options (see GeoNearOptionsDocument and the GeoNearOptions builder).
Public interfaceIMongoGroupBy
A marker interface that represents what to group by (see GroupByDocument and the GroupBy builder).
Public interfaceIMongoIndexKeys
A marker interface that represents the keys of an index (see IndexKeysDocument and the IndexKeys builder).
Public interfaceIMongoIndexOptions
A marker interface that represents options for creating an index (see IndexOptionsDocument and the IndexOptions builder).
Public interfaceIMongoMapReduceOptions Obsolete.
A marker interface that represents options for a map/reduce operation (see MapReduceOptionsDocument and the MapReduceOptions builder).
Public interfaceIMongoQuery
A marker interface that represents a query (see QueryDocument and the Query builder).
Public interfaceIMongoScope
A marker interface that represents a scope (a set of variables with values, see ScopeDocument).
Public interfaceIMongoSortBy
A marker interface that represents a sort order (see SortByDocument and the SortBy builder).
Public interfaceIMongoUpdate
A marker interface that represents an update modifier (see UpdateDocument and the Update builder).
Enumerations

  EnumerationDescription
Public enumerationAggregateOutputMode
Represents the output mode for an aggregate operation.
Public enumerationCollectionSystemFlags
Represents collection system flags.
Public enumerationCollectionUserFlags
Represents collection user flags.
Public enumerationConnectionMode
Server connection mode.
Public enumerationDocumentValidationAction
Represents the document validation action.
Public enumerationDocumentValidationLevel
Represents the document validation level.
Public enumerationEvalFlags
Flags used with the Eval method in MongoDatabase.
Public enumerationFeatureId
Represents the Id of a feature.
Public enumerationFindAndModifyDocumentVersion
Represents a version of a document (original or modified).
Public enumerationInsertFlags
Flags used with the Insert method in MongoCollection.
Public enumerationMapReduceOutputMode
Represents the output mode for a map reduce operation.
Public enumerationMongoServerInstanceType
Represents an instance of a MongoDB server host (in the case of a replica set a MongoServer uses multiple MongoServerInstances).
Public enumerationMongoServerState
The state of a MongoServer instance.
Public enumerationProfilingLevel
Represents what level of profile information to write.
Public enumerationQueryFlags
Flags used with queries (see the SetQueryFlags method of MongoCursor).
Public enumerationReadPreferenceMode
Represents read preference modes.
Public enumerationRemoveFlags
Flags used with the Remove method of MongoCollection.
Public enumerationUpdateFlags
Flags used with the Update method in MongoCollection.
Public enumerationWriteRequestType
Represents the type of a write request.