import pymongo

from config.helper import config

class MongoStore:
    def __init__(self):
        self.client = pymongo.MongoClient(config()['mongo']['uri'])
        self.db = self.client[config()['mongo']['dbname']]
    
    def set_collection(self, collection):
        self.collection = self.db[collection]
    
    def insert_one(self, data):
        return self.collection.insert_one(data)

    def insert_many(self, data):
        return self.collection.insert_many(data)