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

# Packages

Package address provides structured representations of network addresses.
Package description contains types and functions for describing the state of MongoDB clusters.
Package gridfs provides a MongoDB GridFS API.
No description provided by the author
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.
NewClient creates a new client to connect to a deployment specified by the uri.
NewClientEncryption creates a new ClientEncryption instance configured with the given options.
NewCursorFromDocuments creates a new Cursor pre-loaded with the provided documents, error and registry.
NewDeleteManyModel creates a new DeleteManyModel.
NewDeleteOneModel creates a new DeleteOneModel.
NewIndexOptionsBuilder creates a new IndexOptionsBuilder.
NewInsertOneModel creates a new InsertOneModel.
NewReplaceOneModel creates a new ReplaceOneModel.
NewSessionContext creates a new SessionContext associated with the given Context and Session parameters.
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 SessionContext 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.

# 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.
ErrInvalidIndexValue is returned if an index is created with a keys document that has a value that is not a number or string.
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.
ErrUnacknowledgedWrite is returned by operations that have an unacknowledged write concern.
ErrWrongClient is returned when a user attempts to pass in a session created by a different client than the method call is using.

# 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.
ClientEncryption is used to create data keys and explicitly encrypt and decrypt BSON values.
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.
EncryptionKeyVaultError represents an error while communicating with the key vault collection during client-side encryption.
ErrMapForOrderedArgument is returned when a map with multiple keys is passed to a CRUD method for an ordered parameter.
IndexModel represents a new index to be created.
IndexOptionsBuilder specifies options for a new index.
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 client-side encryption.
MongocryptError represents an libmongocrypt error during client-side 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.
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

BSONAppender is an interface implemented by types that can marshal a provided type into BSON bytes and append those bytes to the provided []byte.
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.
Session is an interface that represents a MongoDB logical session.
SessionContext combines the context.Context and mongo.Session interfaces.
WriteModel is an interface implemented by models that can be used in a BulkWrite operation.
XSession is an unstable interface for internal use only.

# Type aliases

BSONAppenderFunc is an adapter function that allows any function that satisfies the AppendBSON method signature to be used where a BSONAppender is used.
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.