from idlelib.multicall import r

import pymongo
myclient = pymongo.MongoClient("mongodb://192.168.0.220:2747/")
mydb = myclient["bana"]

dblist = myclient.list_database_names()
if "bana" in dblist:
  print("The database exists.")

#Create a collection called "customers":
mycol = mydb["assignment_1"]
mycol.find()
print(mydb.list_collection_names())




from fastapi import FastAPI
from mongodb import mongo, get_nvi
from Repository.repo import getData, my_cursor

app = FastAPI()
@app.get("/getData1")
def showdata():

    return getData()


@app.get("/getData2")
def showdata2():
    return get_nvi()
