出處: Youtube 彭彭的課程 Python Flask 網站後端開發 – MongoDB 刪除資料
實作筆記
刪除一筆文件資料
想刪除”number”:”1″


#刪除集合中的一筆文件資料
result = collection.delete_one({
"number":"1"
})
print("實際刪除的文件資料數量",result.deleted_count)


number1 已經不見了
刪除多筆文件資料
接下來想刪除密碼”password”是888的資料


#刪除集合中的多筆文件資料
result = collection.delete_many({
"password":888
})
print("實際刪除的文件資料數量",result.deleted_count)

剩兩筆資料,剛剛兩筆密碼”password”是888的資料已經被刪除了
