modulepackage
0.0.0-20190308170442-1d451d2a3149
Repository: https://github.com/divjotarora/mgo.git
Documentation: pkg.go.dev
# README
The MongoDB driver for Go
Please go to http://labix.org/mgo for all project details.
Testing
Tests require custom orchestration. Install daemontools as a prerequisite and make sure mongod and mongos are in your path. To start the orchestration:
$ export PATH=/path/to/mongodb/bin:$PATH
$ make startdb
To stop the orchestration:
$ make stopdb
Run all tests like this (gocheck.v
turns on verbose output):
$ go test -gocheck.v
To run a specific test, use the gocheck.f
flag:
$ go test -gocheck.v -gocheck.f TestFindAndModifyBug997828
# Packages
Package bson is an implementation of the BSON specification for Go:
http://bsonspec.org
It was created as part of the mgo MongoDB driver for Go, but is standalone and may be used on its own without the driver.
No description provided by the author
The txn package implements support for multi-document transactions.
# Functions
Dial establishes a new session to the cluster identified by the given seed server(s).
DialWithInfo establishes a new session to the cluster identified by info.
DialWithTimeout works like Dial, but uses timeout as the amount of time to wait for a server to respond when first connecting and also on follow up operations in the session.
No description provided by the author
IsDup returns whether err informs of a duplicate key error because a primary key index or a secondary unique index already has an entry with the given value.
ParseURL parses a MongoDB URL as accepted by the Dial function and returns a value suitable for providing into DialWithInfo.
No description provided by the author
Enable the delivery of debug messages to the logger.
Specify the *log.Logger object where log messages should be sent to.
No description provided by the author
# Constants
Same as Nearest, but may change servers between reads.
Same as SecondaryPreferred before first write.
Read from one of the nearest members, irrespective of it being primary or secondary.
Default mode.
Read from the primary if available.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Relevant documentation:
http://docs.mongodb.org/manual/reference/user-privileges/
.
No description provided by the author
No description provided by the author
Read from one of the nearest secondary members of the replica set.
Read from one of the nearest secondaries if available.
Same as Primary.
# Structs
The BuildInfo type encapsulates details about the running MongoDB server.
Bulk represents an operation that can be prepared with several orthogonal changes before being delivered to the server.
BulkError holds an error returned from running a Bulk operation.
BulkErrorCase holds an individual error found while attempting a single change within a bulk operation, and the position in which it was enqueued.
BulkResult holds the results for a bulk operation.
Change holds fields for running a findAndModify MongoDB command via the Query.Apply method.
ChangeInfo holds details about the outcome of an update operation.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
The CollectionInfo type holds metadata about a collection.
Credential holds details to authenticate with a MongoDB server.
No description provided by the author
The DBRef type implements support for the database reference MongoDB convention as supported by multiple drivers.
DialInfo holds options for establishing a session with a MongoDB cluster.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ReadPreference defines the manner in which servers are chosen.
See SetSafe for details on the Safe type.
ServerAddr represents the address for establishing a connection to an individual MongoDB server.
Session represents a communication session with the database.
No description provided by the author
User represents a MongoDB user.