Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
Conn wraps the connection to the MongoDB.
type ConnOptions ¶
type ConnOptions struct {
// contains filtered or unexported fields
}
ConnOptions represents the configuration options for the MongoDB connection Conn.
type Option ¶
type Option func(options *ConnOptions)
Option configures the mongo options.ClientOptions.
func WithAppName ¶
WithAppName sets app name to the connection properties.
func WithConnectTimeout ¶
WithConnectTimeout specifies a timeout that is used for creating connections to the server. This can be set through ApplyURI with the "connectTimeoutMS" (e.g "connectTimeoutMS=30") option. If set to 0, no timeout will be used. The default is 30 seconds.
func WithDirectConnection ¶
WithDirectConnection sets ability to make direct connection.
func WithReadPref ¶
WithReadPref sets the Mongo read preference which determines which servers are considered suitable for read operations.