package
2.1.0
Repository: https://github.com/mongodb/mongo-go-driver.git
Documentation: pkg.go.dev

# Packages

Package address provides structured representations of network addresses.
Package options defines the optional configurations for the MongoDB Go Driver.
Package readconcern defines read concerns for MongoDB operations.
Package readpref defines read preferences for MongoDB queries.
Package writeconcern defines write concerns for MongoDB operations.

# Functions

BatchCursorFromCursor returns a driver.BatchCursor for the given Cursor.
Connect creates a new Client and then initializes it using the Connect method.
IsDuplicateKeyError returns true if err is a duplicate key error.
IsNetworkError returns true if err is a network error.
IsTimeout returns true if err was caused by a timeout.
NewClientDeleteManyModel creates a new ClientDeleteManyModel.
NewClientDeleteOneModel creates a new ClientDeleteOneModel.
NewClientEncryption creates a new ClientEncryption instance configured with the given options.
NewClientInsertOneModel creates a new ClientInsertOneModel.
NewClientReplaceOneModel creates a new ClientReplaceOneModel.
NewClientUpdateManyModel creates a new ClientUpdateManyModel.
NewClientUpdateOneModel creates a new ClientUpdateOneModel.
NewCursorFromDocuments creates a new Cursor pre-loaded with the provided documents, error and registry.
NewDeleteManyModel creates a new DeleteManyModel.
NewDeleteOneModel creates a new DeleteOneModel.
NewInsertOneModel creates a new InsertOneModel.
NewReplaceOneModel creates a new ReplaceOneModel.
NewSessionContext returns a Context that holds the given Session.
NewSingleResultFromDocument creates a SingleResult with the provided error, registry, and an underlying Cursor pre-loaded with the provided document, error and registry.
NewUpdateManyModel creates a new UpdateManyModel.
NewUpdateOneModel creates a new UpdateOneModel.
SessionFromContext extracts the mongo.Session object stored in a Context.
WithSession creates a new session context from the ctx and sess parameters and uses it to call the fn callback.

# Constants

These constants represent valid change stream types.
These constants represent valid change stream types.
These constants represent valid change stream types.
255 KiB.

# Variables

ErrClientDisconnected is returned when disconnected Client is used to run an operation.
ErrEmptySlice is returned when an empty slice is passed to a CRUD method that requires a non-empty slice.
ErrFileNotFound occurs if a user asks to download a file with a file ID that isn't found in the files collection.
ErrInvalidIndexValue is returned if an index is created with a keys document that has a value that is not a number or string.
ErrMissingChunk indicates that the number of chunks read from the server is less than expected.
ErrMissingGridFSChunkSize occurs when downloading a file if the files collection document is missing the "chunkSize" field.
ErrMissingResumeToken indicates that a change stream notification from the server did not contain a resume token.
ErrMultipleIndexDrop is returned if multiple indexes would be dropped from a call to IndexView.DropOne.
ErrNilCursor indicates that the underlying cursor for the change stream is nil.
ErrNilDocument is returned when a nil document is passed to a CRUD method.
ErrNilValue is returned when a nil value is passed to a CRUD method.
ErrNoDocuments is returned by SingleResult methods when the operation that created the SingleResult did not return any documents.
ErrNonStringIndexName is returned if an index is created with a name that is not a string.
ErrNotSlice is returned when a type other than slice is passed to InsertMany.
ErrStreamClosed is an error returned if an operation is attempted on a closed/aborted stream.
ErrWrongClient is returned when a user attempts to pass in a session created by a different client than the method call is using.
ErrWrongSize is used when the chunk retrieved from the server does not have the expected size.

# Structs

BulkWriteError is an error that occurred during execution of one operation in a BulkWrite.
BulkWriteException is the error type returned by BulkWrite and InsertMany operations.
BulkWriteResult is the result type returned by a BulkWrite operation.
ChangeStream is used to iterate over a stream of events.
Client is a handle representing a pool of connections to a MongoDB deployment.
ClientBulkWrite is a struct that can be used in a client-level BulkWrite operation.
ClientBulkWriteDeleteResult is the result type returned by a client-level bulk write DeleteOne and DeleteMany operation.
ClientBulkWriteException is the error type returned by ClientBulkWrite operations.
ClientBulkWriteInsertResult is the result type returned by a client-level bulk write of InsertOne operation.
ClientBulkWriteResult is the result type returned by a client-level BulkWrite operation.
ClientBulkWriteUpdateResult is the result type returned from a client-level bulk write of UpdateOne, UpdateMany, and ReplaceOne operation.
ClientDeleteManyModel is used to delete multiple documents in a client-level BulkWrite operation.
ClientDeleteOneModel is used to delete at most one document in a client-level BulkWriteOperation.
ClientEncryption is used to create data keys and explicitly encrypt and decrypt BSON values.
ClientInsertOneModel is used to insert a single document in a client-level BulkWrite operation.
ClientReplaceOneModel is used to replace at most one document in a client-level BulkWrite operation.
ClientUpdateManyModel is used to update multiple documents in a client-level BulkWrite operation.
ClientUpdateOneModel is used to update at most one document in a client-level BulkWrite operation.
Collection is a handle to a MongoDB collection.
CollectionSpecification represents a collection in a database.
CommandError represents a server error during execution of a command.
Cursor is used to iterate over a stream of documents.
Database is a handle to a MongoDB database.
DatabaseSpecification contains information for a database.
DeleteManyModel is used to delete multiple documents in a BulkWrite operation.
DeleteOneModel is used to delete at most one document in a BulkWriteOperation.
DeleteResult is the result type returned by DeleteOne and DeleteMany operations.
DistinctResult represents an array of BSON data returned from an operation.
EncryptionKeyVaultError represents an error while communicating with the key vault collection during in-use encryption.
ErrMapForOrderedArgument is returned when a map with multiple keys is passed to a CRUD method for an ordered parameter.
GridFSBucket represents a GridFS bucket.
GridFSDownloadStream is a io.Reader that can be used to download a file from a GridFS bucket.
GridFSFile represents a file stored in GridFS.
GridFSUploadStream is used to upload a file in chunks.
IndexModel represents a new index to be created.
IndexSpecification represents an index in a database.
IndexView is a type that can be used to create, drop, and list indexes on a collection.
InsertManyResult is a result type returned by an InsertMany operation.
InsertOneModel is used to insert a single document in a BulkWrite operation.
InsertOneResult is the result type returned by an InsertOne operation.
ListDatabasesResult is a result of a ListDatabases operation.
MarshalError is returned when attempting to marshal a value into a document results in an error.
MongocryptdError represents an error while communicating with mongocryptd during in-use encryption.
MongocryptError represents an libmongocrypt error during in-use encryption.
ReplaceOneModel is used to replace at most one document in a BulkWrite operation.
RewrapManyDataKeyResult is the result of the bulk write operation used to update the key vault collection with rewrapped data keys.
SearchIndexModel represents a new search index to be created.
SearchIndexView is a type that can be used to create, drop, list and update search indexes on a collection.
Session is a MongoDB logical session.
SingleResult represents a single document returned from an operation.
UpdateManyModel is used to update multiple documents in a BulkWrite operation.
UpdateOneModel is used to update at most one document in a BulkWrite operation.
UpdateResult is the result type returned from UpdateOne, UpdateMany, and ReplaceOne operations.
WriteConcernError represents a write concern failure during execution of a write operation.
WriteError is an error that occurred during execution of a write operation.
WriteException is the error type returned by the InsertOne, DeleteOne, DeleteMany, UpdateOne, UpdateMany, and ReplaceOne operations.

# Interfaces

ClientWriteModel is an interface implemented by models that can be used in a client-level BulkWrite operation.
Dialer is used to make network connections.
LabeledError is an interface for errors with labels.
ServerError is the interface implemented by errors returned from the server.
WriteModel is an interface implemented by models that can be used in a BulkWrite operation.

# Type aliases

Pipeline is a type that makes creating aggregation pipelines easier.
StreamType represents the cluster type against which a ChangeStream was created.
WriteErrors is a group of write errors that occurred during execution of a write operation.