Object prevalence model implementation in Scala for MongoDB