intro pyyml

This commit is contained in:
耿伦伦
2021-11-30 20:33:32 +08:00
parent 909f862626
commit 93ff79125f
15 changed files with 57 additions and 10 deletions

View File

@ -1,9 +1,11 @@
import pymongo
from config.helper import config
class MongoStore:
def __init__(self):
self.client = pymongo.MongoClient("mongodb://localhost:27017/")
self.db = self.client['tiktok']
self.client = pymongo.MongoClient(config()['mongo']['uri'])
self.db = self.client[config()['mongo']['dbname']]
def set_collection(self, collection):
self.collection = self.db[collection]