def donate(items): collection = DonateService.get_collection() donation = DonateService.get(items.get('donatedBy')) if not donation: return BaseMongo.insert(collection, items) filters = {'_id': ObjectId(donation.get('id'))} return BaseMongo.replace_one(collection, filters, items)
def add_volunteer(volunteer): volunteer_collection = VolunteersService.get_collection() return BaseMongo.insert(volunteer_collection, volunteer)
def add_report(issue_report_mapping): collection = IssueReportsService.get_collection() return BaseMongo.insert(collection, issue_report_mapping)
def add_issue(issue): essential_collection = IssuesService.get_collection() return BaseMongo.insert(essential_collection, issue)
def add_acknowledgement(issue_volunteer_acknowledgement_mapping): collection = IssuesAcknowledgementsService.get_collection() return BaseMongo.insert(collection, issue_volunteer_acknowledgement_mapping)
def add_plus_one(issue_victim_plus_one_mapping): collection = IssuesPlusOneService.get_collection() return BaseMongo.insert(collection, issue_victim_plus_one_mapping)
def add_reporter(victim): collection = ReportersService.get_collection() return BaseMongo.insert(collection, victim)
def add_victim(victim): collection = VictimsService.get_collection() return BaseMongo.insert(collection, victim)
def add_essential(essential): essential_collection = EssentialsService.get_collection() return BaseMongo.insert(essential_collection, essential)
def add_donor(donor): collection = DonarsService.get_collection() return BaseMongo.insert(collection, donor)