Update app files
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
from mongo_worker import MongoWorker
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
print("Hello World!")
|
||||||
+13
-5
@@ -1,7 +1,15 @@
|
|||||||
import pymongo
|
import pymongo
|
||||||
|
|
||||||
myclient = pymongo.MongoClient("mongodb://localhost:27017/")
|
class MongoWorker():
|
||||||
db = myclient["data"]
|
def __init__(self):
|
||||||
collections = db["game_data"]
|
self.client = pymongo.MongoClient(host="127.0.0.1", port=27017)
|
||||||
print(myclient.list_database_names())
|
self.db = self.client["data"]
|
||||||
print(db.list_collection_names())
|
self.collection = self.db["game_data"]
|
||||||
|
|
||||||
|
def get_mongodb_info(self):
|
||||||
|
print(self.client.list_database_names())
|
||||||
|
print(self.db.list_collection_names())
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
mongo = MongoWorker()
|
||||||
|
mongo.get_mongodb_info()
|
||||||
|
|||||||
Reference in New Issue
Block a user