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 many document mycol.delete_many(query) print('\nDocuments in Collection after delete_many ()\n-----------------------') for doc in mycol.find(): print(doc)
Output