-
-
Save elyphas/b3a71bc5cdd188d80885be4dea6a0419 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class Recipe ( | |
fiscal_period: Int, | |
folio: String, | |
date: java.util.Date, | |
id_area: Option[String], | |
area: Option[String], | |
servicio: Option[String], | |
id_patient: Option[String], | |
) extends Document[Recipe] | |
object Recipe extends DocumentModel[Recipe] { | |
override def indexes: List[Index] = Nil | |
override val collectionName: String = "tblrecipe" | |
override val serialization: Serialization[Recipe] = Serialization.auto[Recipe] | |
} | |
def insert(item: Recipe) = { | |
lazy val collection = dbExample.collection("tblrecipe") | |
for { | |
_ <- db.init() | |
res <- collection.document.insertOne(item) | |
} yield { | |
println("DocumentInsert") | |
println(res) | |
((item, Found())).asRight[String] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment