back-end/threats_monitoring/malwaredomains.py
def connect_to_mongodb():
    """ This function implements the connection to mongoDB
        @returns
            connection  (MongoClient or None)   a MongoClient object to handle the connection. None on failure
    """

    # connect to database
    try:
        connection = MongoClient('XXX.XXX.XXX.XXX', 27017)
        db = connection.admin
        db.authenticate('xxxxxx', 'xxxXXXxxxXX')
        return db

    except PyMongoError as e:
        print("Connection to Data Base failed: ", e)
        return None
 This function implements the connection to mongoDB
        @returns
            connection  (MongoClient or None)   a MongoClient object to handle the connection. None on failure
    
This function implements the connection to mongoDB
@returns
connection  (MongoClient or None)   a MongoClient object to handle the connection. None on failure
This function implements the connection to mongoDB @returns connection ( MongoClient or None ) a MongoClient object to handle the connection . None on failure
def connect_to_mongodb():
    try:
        connection = MongoClient('XXX.XXX.XXX.XXX', 27017)
        db = connection.admin
        db.authenticate('xxxxxx', 'xxxXXXxxxXX')
        return db
    except PyMongoError as e:
        print("Connection to Data Base failed: ", e)
        return None
def connect_to_mongodb ( ) : try : connection = MongoClient ( 'XXX.XXX.XXX.XXX' , 27017 ) db = connection . admin db . authenticate ( 'xxxxxx' , 'xxxXXXxxxXX' ) return db except PyMongoError as e : print ( "Connection to Data Base failed: " , e ) return None
This function implements the connection to mongoDB
@returns
connection  (MongoClient or None)   a MongoClient object to handle the connection.
This function implements the connection to mongoDB @returns connection ( MongoClient or None ) a MongoClient object to handle the connection .
""" This function implements the connection to mongoDB
        @returns
            connection  (MongoClient or None)   a MongoClient object to handle the connection. None on failure
    """ # connect to database
