Run
import pymongo myclient = pymongo.MongoClient("mongodb://localhost:27017/") #use database named "organisation" mydb = myclient["organisation"] #use collection named "developers" mycol = mydb["developers"] print('Documents in Collection\n-----------------------') for doc in mycol.find(): print(doc) #query to delete document query = {'address':'India'} #delete one document mycol.delete_one(query) print('\nDocuments in Collection after delete_one()\n-----------------------') for doc in mycol.find(): print(doc)
Output