data_migrate

This commit is contained in:
王思川 2022-03-17 17:38:06 +08:00
parent 046fb741e2
commit 3f6089653d
1 changed files with 20 additions and 0 deletions

20
DBInitial/FileDemo.py Normal file
View File

@ -0,0 +1,20 @@
import pymongo
HOST = "116.63.130.34"
PASS = "UTlC9cCoglD1cI1*"
USER = "root"
PORT = "27021"
mongo_client = pymongo.MongoClient('mongodb://{}:{}@{}:{}'.format(USER, PASS, HOST, PORT))
def all_data():
collection = mongo_client['']['']
data = list(collection.find({}, {'_id': False}))
###
avatar_id = "623152edf36000004f00124e"
###