Package

eu.akkamo

mongo

Permalink

package mongo

Visibility
  1. Public
  2. All

Type Members

  1. trait MongoApi extends AnyRef

    Permalink

    For each configured MongoDB connection, instance of this trait is registered into the Akkamo context and provides API for working with the connection.

  2. class MongoModule extends Module with Initializable with Disposable

    Permalink

    Akkamo module providing support for MongoDB database using the official Scala driver (see http://mongodb.github.io/mongo-scala-driver/).

    Akkamo module providing support for MongoDB database using the official Scala driver (see http://mongodb.github.io/mongo-scala-driver/).

    Example configuration

    akkamo.mongo {
    
      name1 {
        aliases = [ "alias1", "alias2" ]
        default = true
        uri = "mongodb://user:password@localhost:27017/db_name"
      }
    
      name2 {
        aliases = [ "alias3" ]
        uri = "mongodb://user:password@localhost:27017/db_name2"
      }
    }

    Above is the working example of simple module configuration. In this configuration example, one MongoDB connection is created and will be registered into the Akkamo context. Each configured connection is registered into the Akkamo context as the eu.akkamo.mongo.MongoApi interface and is available for injection via its name (e.g. name1), aliases (if defined, e.g. alias1 or alias2), or if defined as default without any name identifier.

    For more details about the URI connection string format, see the official documentation.

Ungrouped