This repository has been archived on 2024-09-10. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Douyin_Web_Live/store/mongo.py
T
2021-11-29 18:27:02 +08:00

16 lines
431 B
Python

import pymongo
class MongoStore:
def __init__(self):
self.client = pymongo.MongoClient("mongodb://localhost:27017/")
self.db = self.client['tiktok']
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)