import pymongo
import network_constants as netconst
from database.MongoRepositoryBase import MongoRepositoryBase

class MongoRepository(MongoRepositoryBase):
    # TODO extract to docker env var
    _username = 'root'
    _password = 'root'

    _collection: pymongo.collection.Collection = None
    _mongo_client: pymongo.MongoClient = None

    def __init__(self, username=_username, password=_password):
        super().__init__('traceRetrievalDB', 'traces')

    def insert_trace(self, content: dict):
        super().insert_entry(content)

    def get_traces(self, selection: dict = {}, projection: dict = {'_': 0}) -> pymongo.cursor.Cursor:
        return super().get_entries(selection, projection)

