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
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,
mechanismmust be one of:SCRAM-SHA-1- default for MongoDB 3.x +MONGODB-CR- default for MongoDB 2.x
- authentications
abstract Str:Str authenticationsA map of databases -> users this connection is authenticated as.
- close
abstract Void close()Closes the connection. Should never throw an IOErr.
- in
abstract InStream in()Data from MongoDB to the client.
- isClosed
abstract Bool isClosed()Return
trueif this socket is closed.- logout
abstract Void logout(Str databaseName, Bool checked := true)Logs this connection out from the given database.
- out
abstract OutStream out()Data to MongoDB from the client.