Community contributed extensions

PlayMorphia configuration

This page list all available configuration items along with it’s definition and default value. To use PlayMorphia configuration, you just need to add them into your conf/application.conf file. If a configuration item is missing from the conf/application.conf then it’s default value will be used.

MongoDB Connection

ID Description default value
morphia.db.seedsdefine mongodb server to be connected. Note, this item takes precedence over morphia.db.host and morphia.db.port. E.g, server1:port1,server2:port2...None
morphia.db.hostdefine the mongodb server host to be connected. Note this configuration is deprecated. Please use morphia.db.seeds insteadlocalhost
morphia.db.portdefine the mongodb server port to be connected. Note this is deprecated. Please use morphia.db.seeds instead27017
morphia.db.namedefine the database name that is accessed by the applicationtest

Secure MongoDB access

ID Description default value
morphia.db.usernamedefine the username to be used to access MongoDB. See MongoDB security and authenticationblank
morphia.db.passworddefine the password to be used to access MongoDB. See MongoDB security and authenticationblank

When either one of the above configuration is missing, PlayMorphia will try to access MongoDB without authentication.

Miscellaneous configurations

ID Description default value
morphia.loggerEnable/disable Morphia log. When this configuration set to true, Morphia log is enabled. Remove this confiuration item to disable Morphia logfalse
morphia.collection.uploadSet the GridFS collection nameuploads
morphia.id.typeDefine the default ID field type. Could be any one of "Long" and "ObjectId"ObjectId
morphia.postPluginEventWhen set to true, PlayMorphia will post entity lifecycle events to Play plugin’s event framework. Note turning on this configuration might impact performance a little bitfalse
morphia.autoRegisterEventHandlerWhen set to true, PlayMorphia will automatically register lifecycle event handler using annotations. See heretrue
morphia.defaultWriteConcernSet default writeconcern. Could one of "FSYNC_SAFE", "NONE", "NORMAL", "REPLICAS_SAFE", "SAFE". See here for detailsSAFE

See also

  1. Getting start
  2. “Morphia documetation home”#home