Skip to content

Instantly share code, notes, and snippets.

@elyphas
Created May 1, 2021
Embed
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] = 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