import pymongo


class DatabaseSClass(object) :def __init__(self.db_name) :self.mongo_client = pymongo.MongoClient('mongo: / / user_name: [email protected]:27017 /')
        self.db_name = db_name
        self.db_cursor = self.mongo_client[self.db_name]
        self.ai_anchor_host_col = self.db_cursor['ai_anchor_host']
 
    def find_all_data(self, col_str):
        print(f"col_str = {col_str}")
        cursor = col_str.find({}, {'_id': 0})
        return list(cursor)
 
    def insert_many(self, col_str, data_list):
        res = col_str.insert_many(data_list)
        return res
Copy the code