Run
import pymongo myclient = pymongo.MongoClient("mongodb://localhost:27017/") #use database named "organisation" mydb = myclient["organisation"] #use collection named "developers" mycol = mydb["developers"] #a document developer = { "name": "Lini", "address": "Sweden" } #insert a document to the collection x = mycol.insert_one(developer) #list the databases for db in myclient.list_databases(): print(db)
Output