Update app files
This commit is contained in:
+13
-5
@@ -1,7 +1,15 @@
|
||||
import pymongo
|
||||
|
||||
myclient = pymongo.MongoClient("mongodb://localhost:27017/")
|
||||
db = myclient["data"]
|
||||
collections = db["game_data"]
|
||||
print(myclient.list_database_names())
|
||||
print(db.list_collection_names())
|
||||
class MongoWorker():
|
||||
def __init__(self):
|
||||
self.client = pymongo.MongoClient(host="127.0.0.1", port=27017)
|
||||
self.db = self.client["data"]
|
||||
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