MongoFormats

uk.gov.hmrc.mongo.play.json.formats.MongoFormats
See theMongoFormats companion trait
object MongoFormats extends MongoFormats

Attributes

Companion
trait
Graph
Supertypes
trait MongoFormats
class Object
trait Matchable
class Any
Self type

Members list

Type members

Inherited classlikes

object Implicits extends Implicits

Attributes

Inherited from:
MongoFormats
Supertypes
trait Implicits
class Object
trait Matchable
class Any
trait Implicits

Attributes

Inherited from:
MongoFormats
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Implicits

Value members

Deprecated and Inherited methods

def mongoEntity[A](baseFormat: Format[A]): Format[A]

Maps a Format for an entity with 'id' field to mongo by renaming the id field to internal '_id'. Useful for auto generated Formats, where the model id key is named 'id'.

Maps a Format for an entity with 'id' field to mongo by renaming the id field to internal '_id'. Useful for auto generated Formats, where the model id key is named 'id'.

case class MyObject(id: ObjectId)
val formats: Format[MyObject] = mongoEntity(Json.format[MyObject]}

This is deprecated since an explicit Format, mapping id to _id is preferred. Also any queries on id would still need to use the underlying '_id' name.

Attributes

Deprecated
true
Inherited from:
MongoFormats

Inherited fields

final val objectIdFormat: Format[ObjectId]

Attributes

Inherited from:
MongoFormats
final val objectIdReads: Reads[ObjectId]

Attributes

Inherited from:
MongoFormats
final val objectIdWrites: Writes[ObjectId]

Attributes

Inherited from:
MongoFormats