# How to insert a row?


  • To insert:






     

    val row = LotteryRow(
      lotteryName = "metastayLotteryContest",
      participantList = List("Rekha", "Aashish", "Lek"),
      open = true
    )
    LotteryWriter().insert(row)
    

  • To save:






     

    val row = LotteryRow(
      lotteryName = "metastayLotteryContest",
      participantList = List("Rekha", "Aashish", "Lek"),
      open = true
    )
    LotteryWriter().save(row)
    

Explantion

save vs insert

For save, if you provide _id, it will update. If you don't, it will insert. Functionally, save and insert are very similar, especially if no _id value is passed.