Namespace MongoDB.Driver
| MongoDB CSharp Driver API Reference (original) (raw)
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
Represents options for the BucketAuto method.
AggregateBucketAutoResultIdSerializer
Static factory class for AggregateBucketAutoResultIdSerializer.
AggregateBucketAutoResultIdSerializer
A serializer for AggregateBucketAutoResultId.
Represents the _id value in the result of a $bucketAuto stage.
Represents the result of the $bucketAuto stage.
Represents options for the Bucket method.
Represents the result of the $bucket stage.
Result type for the aggregate $count stage.
AggregateExpressionDefinition<TSource, TResult>
An aggregation expression.
Represents static methods for creating facets.
Options for the aggregate $facet stage.
Represents an abstract AggregateFacetResult with an arbitrary TOutput type.
Represents the result of a single facet.
Represents the results of a $facet stage with an arbitrary number of facets.
Represents a facet to be passed to the Facet method.
AggregateFacet<TInput, TOutput>
Represents a facet to be passed to the Facet method.
Base class for implementors of IAggregateFluent.
AggregateGraphLookupOptions<TFrom, TAsElement, TOutput>
Represents options for the GraphLookup method.
AggregateLookupOptions<TForeignDocument, TResult>
Options for the aggregate $lookup stage.
Options for an aggregate operation.
Result type for the aggregate $sortByCount stage.
Options for the $unwind aggregation stage.
AppendedStagePipelineDefinition<TInput, TIntermediate, TOutput>
Represents a pipeline consisting of an existing pipeline with one additional stage appended.
Base class for array filters.
Base class for array filters.
Auto encryption options.
BatchTransformingAsyncCursor<TFromDocument, TToDocument>
Represents a cursor that wraps another cursor with a transformation function on the documents.
Contains extensions methods for BinaryVector
BsonDocumentArrayFilterDefinition
A BsonDocument based array filter.
A BsonDocument based command.
A BsonDocument based filter.
BsonDocumentIndexKeysDefinition
A BsonDocument based index keys definition.
BsonDocumentPipelineStageDefinition<TInput, TOutput>
A BsonDocument based stage.
BsonDocumentProjectionDefinition
A BsonDocument based projection whose projection type is not yet known.
BsonDocumentProjectionDefinition<TSource, TProjection>
A BsonDocument based projection.
A BsonDocument based sort.
BsonDocumentStagePipelineDefinition<TInput, TOutput>
A pipeline composed of instances of BsonDocument.
A BsonDocument based update.
BsonValueAggregateExpressionDefinition<TSource, TResult>
A BsonValue based aggregate expression.
A static helper class containing various builders.
Represents delete many operation in the scope of BulkWrite operation.
Represents delete one operation in the scope of BulkWrite operation.
Represents result BulkWriteDeleteOneModel or BulkWriteDeleteManyModel operation.
Represents the details of a write error for a particular request.
Represents insert one operation in the scope of BulkWrite operation.
Represents result of BulkWriteInsertOneModel operation.
Represents base class for all operations in the scope of bulk write.
Options for a bulk write operation.
Represents replace one operation in the scope of BulkWrite operation.
Represents the result of a bulk write operation.
Represents the result of a bulk write operation.
Result from an acknowledged write concern.
BulkWriteResult.Unacknowledged
Result from an unacknowledged write concern.
Represents update many operation in the scope of BulkWrite operation.
Represents update one operation in the scope of BulkWrite operation.
Represents update operation result in the scope of BulkWrite.
Represents the information about one Upsert.
ChangeStreamDocumentSerializer
A serializer for ChangeStreamDocument instances.
An output document from a $changeStream pipeline stage.
ChangeStreamOperationTypeSerializer
A serializer for ChangeStreamOperationType values.
Options for a change stream operation.
ChangeStreamPreAndPostImagesOptions
Change stream pre and post images options.
Change stream splitEvent data.
Options for a $changeStream stage.
An UpdateDescription in a ChangeStreamDocument instance.
ChangeStreamUpdateDescriptionSerializer
A serialize for ChangeStreamUpdateDescription values.
Represents a bulk write exception.
Options for a bulk write operation.
Represents BulkWrite operation results.
Client session options.
ClientSideDeserializationProjectionDefinition<TSource, TProjection>
A client side only projection that is implemented solely by deserializing using a different serializer.
ClientSideProjectionDeserializer<TInput, TProjection>
A deserializer for doing client side projections.
Represents a registry of already created clusters.
Options for creating a clustered index.
Represents a MongoDB collation.
Represents a collection namespace.
Base class for commands.
ConstantSetFieldDefinition<TDocument, TField>
A SetFieldDefinition that uses a field and a a constant to define the field to be set.
Represents the options parameter for Convert<TFrom, TTo>(TFrom, ConvertOptions).
Represents the options parameter for Convert<TFrom, TTo>(TFrom, ConvertOptions). This class allows to set 'onError' and 'onNull'.
Options for a count operation.
Options for creating a collection.
Options for creating a collection.
Represents a create index commit quorum.
CreateIndexCommitQuorumWithMode
Represents a CreateIndexCommitQuorum with a mode value.
Represents a CreateIndexCommitQuorum with a w value.
Model for creating an index.
Options for creating an index.
Options for creating an index.
Options for creating multiple indexes.
Options for creating a single index.
Model for creating a search index.
Options for creating a view.
Represents a database namespace.
Represents a cursor for an operation that is not actually executed until MoveNextAsync is called for the first time.
Model for deleting many documents.
Model for deleting a single document.
Options for the Delete methods.
The result of a delete operation.
The result of an acknowledged delete operation.
The result of an unacknowledged delete operation.
Represents keyword densify bounds.
Represents a DateTime densify bounds.
Represents a DateTime densify range.
Represents a keyword DateTime densify bounds.
Represents a keyword numeric densify bounds.
DensifyLowerUpperDateTimeBounds
Represents a DateTime densify bounds with lower and upper bounds.
DensifyLowerUpperNumericBounds
Represents a numeric densify bounds with lower and upper bounds.
Represents a numeric densify bounds.
Represents a numeric densify range.
Represents a range for the $densify stage.
Options for the distinct command.
DocumentsAggregateExpressionDefinition
An aggregate expression for the $documents stage.
Represents a documents window for a SetWindowFields window method.
Represents a boundary for a documents window in SetWindowFields.
Options for dropping a collection.
Options for dropping an index.
Represents an empty pipeline.
Options for estimated document count.
ExpressionAggregateExpressionDefinition<TSource, TResult>
A BsonValue based aggregate expression.
An Expression based field.
ExpressionFieldDefinition<TDocument, TField>
An Expression based field.
An Expression based filter.
ExpressionSetFieldDefinitions<TDocument, TFields>
A subclass of SetFieldDefinition that uses an Expression to define the fields to be set.
Options for controlling translation from .NET expression trees into MongoDB expressions.
Evidence of a MongoIdentity via an external mechanism. For example, on windows this may be the current process' user or, on linux, via kinit.
Base class for field names.
FieldDefinition<TDocument, TField>
Base class for field names.
A builder for a FilterDefinition.
Base class for filters.
FindExpressionProjectionDefinition<TSource, TProjection>
A find Expression based projection.
FindFluentBase<TDocument, TProjection>
Base class for implementors of IFindFluent<TDocument, TProjection>.
Options for a findAndModify command to delete an object.
FindOneAndDeleteOptions<TDocument, TProjection>
Options for a findAndModify command to delete an object.
Options for a findAndModify command to replace an object.
FindOneAndReplaceOptions<TDocument, TProjection>
Options for a findAndModify command to replace an object.
Options for a findAndModify command to update an object.
FindOneAndUpdateOptions<TDocument, TProjection>
Options for a findAndModify command to update an object.
Options for finding documents.
Options for a find operation.
Options for finding documents.
FindOptions<TDocument, TProjection>
Options for finding documents.
GeoNearOptions<TInputDocument, TOutputDocument>
Represents options for the $geoNear stage.
Extension methods for IAggregateFluent
Represents extension methods for IAsyncCursor.
Represents extension methods for IAsyncCursorSource.
Extension methods for IFindFluent<TDocument, TProjection>
Extension methods on IMongoClient.
Extension methods for IMongoCollection.
Extension methods on IMongoDatabase.
Represents a partition for SetWindowFields.
A builder for an IndexKeysDefinition.
Extension methods for an index keys definition.
Base class for an index keys definition.
Represents index option defaults.
Options for inserting many documents.
Model for inserting a single document.
Options for inserting one document.
A JSON string based array filter.
A JSON string based command.
A JSON string based filter.
A JSON string based index keys definition.
JsonPipelineStageDefinition<TInput, TOutput>
A JSON string based pipeline stage.
A JSON string based projection whose projection type is not yet known.
JsonProjectionDefinition<TSource, TProjection>
A JSON string based projection.
A JSON string based sort.
A JSON string based update.
KeywordDocumentsWindowBoundary
Represents a keyword boundary for a document window in SetWindowFields (i.e. "unbounded" or "current").
Represents a keyword boundary for a range window in SetWindowFields (i.e. "unbounded" or "current").
Options for a list collection names operation.
Options for a list collections operation.
Options for a list database names operation.
Options for a list databases operation.
Options for a list indexes operation.
ListSetFieldDefinitionsExtensions
Extension methods to add additional set field definitions to an existing instance of ListSetFieldDefinitions.
A subclass of SetFieldDefinitions containing a list of SetFieldDefinition instances to define the fields to be set.
MapReduceOptions<TDocument, TResult>
Represents the options for a map-reduce operation.
Represents the output options for a map-reduce operation.
Options for the $merge aggregation pipeline stage.
Represents a MongoDB authentication exception.
Represents a bulk write exception.
Represents a bulk write exception.
Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
Represents a MongoDB client exception.
The settings for a MongoDB client.
The settings used to access a collection.
Represents a MongoDB command exception.
Represents a MongoDB configuration exception.
MongoConnectionClosedException
Represents a MongoDB connection failed exception.
Represents a MongoDB connection exception.
MongoConnectionPoolPausedException
Represents a MongoDB connection pool paused exception.
Credential to access a MongoDB database.
Represents a MongoDB cursor not found exception.
Represents a DBRef (a convenient way to refer to a document).
Represents a serializer for MongoDBRefs.
The settings used to access a database.
Default values for various Mongo settings.
Represents a MongoDB duplicate key exception.
Represents a MongoDB exception.
MongoExecutionTimeoutException
Represents a MongoDB execution timeout exception.
Represents an identity defined by AWS external credentials.
Represents an identity defined outside of mongodb.
Represents an identity in MongoDB.
Evidence used as proof of a MongoIdentity.
MongoIncompatibleDriverException
Represents a MongoDB incompatible driver exception.
Base class for implementors of IMongoIndexManager.
Represents a MongoDB internal exception (almost surely the result of a bug).
Represents an identity defined inside mongodb.
MongoNodeIsRecoveringException
Represents a MongoDB node is recovering exception.
Represents a MongoDB not primary exception.
Represents an OIDC identity.
Represents a MongoDB query exception.
The address of a MongoDB server.
Represents a MongoDB server exception.
Represents an immutable URL style connection string. See also MongoUrlBuilder.
Represents URL-style connection strings.
Implements a TypeConverter for converting MongoUrl.
Various static utility methods.
Represents a MongoDB connection pool wait queue full exception.
Represents a MongoDB write concern exception.
Represents a write exception.
Represents an identity defined by an X509 certificate.
Contains methods that can be used to access MongoDB specific functionality in LINQ queries.
Represents the void input data type to a pipeline with no input, such as a database aggregation. No actual instances of this type can be created.
An Object based command.
An Object based filter.
An Object based projection whose projection type is not yet known.
ObjectProjectionDefinition<TSource, TProjection>
An Object based projection.
An Object based sort.
An Object based update.
Represents helper methods for use with the Optional struct.
Evidence of a MongoIdentity via a shared secret.
Extension methods for adding stages to a pipeline.
PipelineDefinition<TInput, TOutput>
Base class for a pipeline.
PipelineStageDefinitionBuilder
Methods for building pipeline stages.
PipelineStageDefinition<TInput, TOutput>
Base class for pipeline stages.
PipelineStagePipelineDefinition<TInput, TOutput>
A pipeline composed of instances of IPipelineStageDefinition.
A PipelineDefinition<TInput, TOutput> based update definition.
PositionDocumentsWindowBoundary
Represents a position boundary for a document window in SetWindowFields.
PrependedStagePipelineDefinition<TInput, TIntermediate, TOutput>
Represents a pipeline consisting of an existing pipeline with one additional stage prepended.
A builder for a projection.
ProjectionDefinitionExtensions
Extension methods for projections.
Base class for projections whose projection type is not yet known.
ProjectionDefinition<TSource, TProjection>
Base class for projections.
Vector search query vector.
Represents a range window for a SetWindowFields window method.
Represents a boundary for a range window in SetWindowFields.
Represents options for the $rankFusion stage.
Represents a read concern.
Represents a read preference.
Represents a read preference hedge.
Options for renaming a collection.
A rendered command.
A rendered field.
A rendered field.
A rendered pipeline.
RenderedPipelineStageDefinition
A rendered pipeline stage.
A rendered projection.
Model for replacing a single document.
The result of an update operation.
The result of an acknowledged update operation.
ReplaceOneResult.Unacknowledged
The result of an unacknowledged update operation.
Options for replacing a single document.
Options for replacing a single document and specifying a sort order.
ReplaceOutputSerializerPipelineDefinition<TInput, TIntermediate, TOutput>
Represents a pipeline with the output serializer replaced.
Represents a server API.
Represents a server API version.
A definition of a single field to be set.
A builder for SetFieldDefinitions.
Defines the fields to be set by a $set stage.
Represents a window for a SetWindowFields window method.
A builder for a SortDefinition.
Extension methods for SortDefinition.
Base class for sorts.
Represents the settings for using SSL.
A string based field name.
StringFieldDefinition<TDocument, TField>
A string based field name.
Represents a value that is either a string or a BsonRegularExpression.
Represents a replica set member tag.
Represents a replica set member tag set.
Represents text search options.
Represents a time boundary for a range window in SetWindowFields.
Defines the time series options to use when creating a time series collection. See https://www.mongodb.com/docs/manual/reference/command/create/ for supported options and https://www.mongodb.com/docs/manual/core/timeseries-collections/ for more information on time series collections.
Transaction options.
A builder for an UpdateDefinition.
Extension methods for UpdateDefinition.
Base class for updates.
Model for updating many documents.
Model for updating a single document.
Options for updating a single document.
Options for updating a single document and specifying a sort order.
The result of an update operation.
The result of an acknowledged update operation.
The result of an acknowledged update operation.
Represents a value boundary for a document window in SetWindowFields.
Represents a value boundary for a range window in SetWindowFields.
Vector search options.
Represents a write concern.
Represents a numeric WValue.
Represents a mode string WValue.
Represents the base class for w values.
Represents the details of a write concern error.
Represents the results of an operation performed with an acknowledged WriteConcern.
Represents the details of a write error.
Base class for a write model.
Structs
AggregateBucketAutoGranularity
Represents the granularity value for a $bucketAuto stage.
Represents an optional parameter that might or might not have a value.
Encapsulates settings needed for path rendering.
Encapsulates settings needed for rendering Builder definitions.
Represents a setting that may or may not have been set.
Interfaces
Fluent interface for aggregate.
Represents an operation that will return a cursor when executed.
Represents an asynchronous cursor.
Represents an asynchronous cursor for change stream.
The interface for a client session.
A handle to an underlying reference counted IClientSession.
The interface for a core server session.
Extension Manager provides a way to configure extensions for the driver.
A filtered mongo collection. The filter will be and'ed with all filters.
IFindFluent<TDocument, TProjection>
Fluent interface for find.
The client interface to MongoDB.
Represents a typed collection in MongoDB.
Represents a database in MongoDB.
An interface representing methods used to create, delete and modify indexes.
Fluent interface for aggregate.
IOrderedFindFluent<TDocument, TProjection>
Fluent interface for find.
A pipeline stage.
IRenderedPipelineStageDefinition
A rendered pipeline stage.
The interface for a server session.
Enums
Represents the byte order of binary data when converting to/from numerical types using Convert<TFrom, TTo>(TFrom, ConvertOptions).
ChangeStreamFullDocumentBeforeChangeOption
Change stream FullDocumentBeforeChange option.
ChangeStreamFullDocumentOption
Change stream FullDocument option.
The operation type of a change stream result.
Controls whether spaces and punctuation are considered base characters.
Uppercase or lowercase first.
Controls which characters are affected by alternate: "Shifted".
Prioritizes the comparison properties.
The cursor type.
Represents a densify DateTime unit.
Represents the document validation action.
Represents the document validation level.
The behavior of $merge is a result document and an existing document in the collection have the same value for the specified on field(s).
The behavior of $merge if a result document does not match an existing document in the output collection.
The level of the read concern.
Represents the read preference mode.
Which version of the document to return when executing a FindAndModify command.
Represents an Atlas search index type.
Represents the category for an error from the server.
Represents server versions.
The direction of the sort.
Specifies the granularity of time series collection bucketing.
UpdateDefinitionCurrentDateType
The type to use for a $currentDate operator.
The type of a write model.