Slide 35
Slide 35 text
Scala
case class Book(id: ObjectId, author: String,
isbn: String, price: Price,
year: Int, tags: Seq[String],
title: String, publisher: String,
edition: Option[String]) {
def toDBObject = MongoDBObject(
"_id" -> id,
"author" -> author,
"isbn" -> isbn,
"price" -> price.toDBObject,
"publicationYear" -> year,
"tags" -> tags,
"title" -> title,
"publisher" -> publisher,
"edition" -> edition
)
}