PlayMongoRepository
uk.gov.hmrc.mongo.play.json.PlayMongoRepository
class PlayMongoRepository[A](mongoComponent: MongoComponent, val collectionName: String, val domainFormat: Format[A], val indexes: Seq[IndexModel], val optSchema: Option[BsonDocument], replaceIndexes: Boolean, extraCodecs: Seq[Codec[_]])(implicit evidence$1: ClassTag[A], ec: ExecutionContext) extends MongoDatabaseCollection
Initialise a mongo repository.
Value parameters
- collectionName
-
the name of the mongo collection.
- domainFormat
-
a play Json format to map the domain to mongo entities.
- extraCodecs
-
optional - to support more types
- indexes
-
indexes to ensure are created.
- optSchema
-
optional - to validate entities written to the collection
- replaceIndexes
-
optional - default is false If true, existing indices should be removed/updated to match the provided indices. If false, any old indices are left behind, and indices with changed definitions will throw IndexConflict exceptions.
Attributes
- Graph
-
- Supertypes
-
trait MongoDatabaseCollectionclass Objecttrait Matchableclass Any
- Known subtypes
-
class MongoLockRepository
Members list
In this article