Skip to content

Instantly share code, notes, and snippets.

Created May 1, 2021
What would you like to do?
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] =[Recipe]
def insert(item: Recipe) = {
lazy val collection = dbExample.collection("tblrecipe")
for {
_ <- db.init()
res <- collection.document.insertOne(item)
} yield {
((item, Found())).asRight[String]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment