mixinafMongo::Connection

afMongo::Connection

Represents a connection to a MongoDB instance. All connections on creation should be connected to a MongoDB instance and ready to go.

Default implementation is a TcpConnection.

authenticate

Source

abstract Void authenticate(Str databaseName, Str userName, Str password, Str? mechanism := null)

Authenticates this connection against a database with the given user credentials. If given, mechanism must be one of:

  • SCRAM-SHA-1 - default for MongoDB 3.x +
  • MONGODB-CR - default for MongoDB 2.x
authentications

Source

abstract Str:Str authentications

A map of databases -> users this connection is authenticated as.

close

Source

abstract Void close()

Closes the connection. Should never throw an IOErr.

in

Source

abstract InStream in()

Data from MongoDB to the client.

isClosed

Source

abstract Bool isClosed()

Return true if this socket is closed.

logout

Source

abstract Void logout(Str databaseName, Bool checked := true)

Logs this connection out from the given database.

out

Source

abstract OutStream out()

Data to MongoDB from the client.