How should I structure my nested reactivemongo calls in my play2 application?
I'm in the process of trying to combine some nested calls with reactivemongo in my play2 application. I get a list of objects returned from createObjects . I then loop over them, check if the object exist in the collection and if not insert them: def dostuff() = Action { implicit request => form.bindFromRequest.fold( errors => BadRequest(views.html.invite(errors)), form => { val objectsReadyForSave = createObjects(form.companyId, form.companyName, sms_pattern.findAllIn(form.phoneNumbers).toSet) Async { for(object <- objectsReadyForSave) { collection.find(BSONDocument("cId" -> object.get.cId,