Skip to content
Snippets Groups Projects

Implement Mongo Seeder v2

Merged D'Abrantes, Felipe (UG - Comp Sci & Elec Eng) requested to merge mongo-seeder-v2 into main
1 unresolved thread
2 files
+ 21
0
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -29,3 +29,22 @@ class QuestionRepository extends Repository[Question] (
})
}
}
object QuestionRepository {
def seedDatabase(): Unit = {
println("Seeding Question Database...")
try {
Question.createQuestionAsync("Who is there?")
Question.createQuestionAsync("How is that there?")
Question.createQuestionAsync("Where is there?")
println("Successfully seeded Question Database!")
} catch {
case ex: Throwable => {
println("Error seeding Question Database...")
println(ex)
}
}
}
}
Loading