Executes a MongoDB command
in a database dbname
and returns the result as a BSON document
or Cursor handle depending on the command. On error, returns nil
and the error message.
Returns a new Collection handle with database name dbname
and collection name collname
.
Returns a new Database handle.
Returns a list of the names of all databases on the server. On error, returns nil
and the error
message.
Returns a new Database handle with the default database name.
Creates a MongoDB GridFS instance in database dbname
and returns its GridFS handle.
On error, returns nil
and the error message.
Returns the default read preferences.
Sets the default read preferences.